stats

package
v1.3.12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 7, 2022 License: MIT Imports: 30 Imported by: 2

Documentation

Overview

Package stats provides methods and functionality to register, track, log, and StatsD-notify statistics that, for the most part, include "counter" and "latency" kinds.

  • Copyright (c) 2018-2022, NVIDIA CORPORATION. All rights reserved.

Package stats provides methods and functionality to register, track, log, and StatsD-notify statistics that, for the most part, include "counter" and "latency" kinds.

  • Copyright (c) 2018-2022, NVIDIA CORPORATION. All rights reserved.

Package stats provides methods and functionality to register, track, log, and StatsD-notify statistics that, for the most part, include "counter" and "latency" kinds.

  • Copyright (c) 2018-2022, NVIDIA CORPORATION. All rights reserved.

Index

Constants

View Source
const (
	KindCounter = "counter"
	KindGauge   = "gauge"
	// + semantics
	KindLatency            = "latency"
	KindThroughput         = "bw"
	KindComputedThroughput = "compbw"
	KindSpecial            = "special"
)
View Source
const (
	// KindCounter
	GetCount         = "get.n"
	PutCount         = "put.n"
	AppendCount      = "append.n"
	DeleteCount      = "del.n"
	RenameCount      = "ren.n"
	ListCount        = "lst.n"
	ErrCount         = "err.n"
	ErrGetCount      = "err.get.n"
	ErrDeleteCount   = "err.delete.n"
	ErrPostCount     = "err.post.n"
	ErrPutCount      = "err.put.n"
	ErrHeadCount     = "err.head.n"
	ErrListCount     = "err.list.n"
	ErrRangeCount    = "err.range.n"
	ErrDownloadCount = "err.dl.n"

	// KindLatency
	GetLatency       = "get.ns"
	ListLatency      = "lst.ns"
	KeepAliveLatency = "kalive.ns"

	// KindSpecial
	Uptime = "up.ns.time"
)

CoreStats stats

View Source
const (
	// KindCounter - QPS and byte counts (always incremented, never reset)
	GetColdCount      = "get.cold.n"
	GetColdSize       = "get.cold.size"
	LruEvictSize      = "lru.evict.size"
	LruEvictCount     = "lru.evict.n"
	CleanupStoreSize  = "cleanup.store.size"
	CleanupStoreCount = "cleanup.store.n"
	VerChangeCount    = "vchange.n"
	VerChangeSize     = "vchange.size"

	// intra-cluster transmit & receive
	StreamsOutObjCount = transport.OutObjCount
	StreamsOutObjSize  = transport.OutObjSize
	StreamsInObjCount  = transport.InObjCount
	StreamsInObjSize   = transport.InObjSize

	// errors
	ErrCksumCount    = "err.cksum.n"
	ErrCksumSize     = "err.cksum.size"
	ErrMetadataCount = "err.md.n"
	ErrIOCount       = "err.io.n"
	// special
	RestartCount = "restart.n"

	// KindLatency
	PutLatency      = "put.ns"
	AppendLatency   = "append.ns"
	GetRedirLatency = "get.redir.ns"
	PutRedirLatency = "put.redir.ns"
	DownloadLatency = "dl.ns"

	// DSort
	DSortCreationReqCount    = "dsort.creation.req.n"
	DSortCreationReqLatency  = "dsort.creation.req.ns"
	DSortCreationRespCount   = "dsort.creation.resp.n"
	DSortCreationRespLatency = "dsort.creation.resp.ns"

	// Downloader
	DownloadSize = "dl.size"

	// KindThroughput
	GetThroughput = "get.bps" // bytes per second
)

Naming Convention:

-> "*.n" - counter
-> "*.ns" - latency (nanoseconds)
-> "*.size" - size (bytes)
-> "*.bps" - throughput (in byte/s)
-> "*.id" - ID

Variables

This section is empty.

Functions

This section is empty.

Types

type ClusterStats

type ClusterStats struct {
	Proxy  *DaemonStats            `json:"proxy"`
	Target map[string]*DaemonStats `json:"target"`
}

type ClusterStatsRaw

type ClusterStatsRaw struct {
	Proxy  *DaemonStats    `json:"proxy"`
	Target cos.JSONRawMsgs `json:"target"`
}

type CoreStats

type CoreStats struct {
	Tracker statsTracker
	// contains filtered or unexported fields
}

func (*CoreStats) MarshalJSON

func (s *CoreStats) MarshalJSON() ([]byte, error)

func (*CoreStats) UnmarshalJSON

func (s *CoreStats) UnmarshalJSON(b []byte) error

type DaemonStats

type DaemonStats struct {
	Tracker copyTracker `json:"tracker"`
	MPCap   fs.MPCap    `json:"capacity"`
}

type DaemonStatus

type DaemonStatus struct {
	Snode          *cluster.Snode `json:"snode"`
	Stats          *CoreStats     `json:"daemon_stats"`
	Capacity       fs.MPCap       `json:"capacity"`
	RebSnap        *RebalanceSnap `json:"rebalance_snap,omitempty"`
	Status         string         `json:"status"`
	DeploymentType string         `json:"deployment"`
	Version        string         `json:"ais_version"`  // major.minor.build
	BuildTime      string         `json:"build_time"`   // YYYY-MM-DD HH:MM:SS-TZ
	K8sPodName     string         `json:"k8s_pod_name"` // (via ais-k8s/operator `MY_POD` env var)
	MemCPUInfo     cos.MemCPUInfo `json:"sys_info"`
	SmapVersion    int64          `json:"smap_version,string"`
}

REST API

type DaemonStatusMap

type DaemonStatusMap map[string]*DaemonStatus // by SID (aka DaemonID)

type Prunner

type Prunner struct {
	// contains filtered or unexported fields
}

func (*Prunner) Add

func (r *Prunner) Add(name string, val int64)

common impl NOTE: currently, proxy's stats == common and hardcoded

func (*Prunner) AddErrorHTTP

func (r *Prunner) AddErrorHTTP(method string, val int64)

func (*Prunner) AddMany

func (r *Prunner) AddMany(nvs ...cos.NamedVal64)

func (*Prunner) Collect

func (r *Prunner) Collect(ch chan<- prometheus.Metric)

func (*Prunner) CoreStats

func (r *Prunner) CoreStats() *CoreStats

func (*Prunner) Describe

func (r *Prunner) Describe(ch chan<- *prometheus.Desc)

func (*Prunner) Get

func (r *Prunner) Get(name string) (val int64)

func (*Prunner) GetWhatStats

func (r *Prunner) GetWhatStats() *DaemonStats

func (*Prunner) Init

func (r *Prunner) Init(p cluster.Node) *atomic.Bool

All stats that proxy currently has are CoreStats which are registered at startup

func (*Prunner) IsPrometheus

func (r *Prunner) IsPrometheus() bool

func (*Prunner) Name

func (r *Prunner) Name() string

func (*Prunner) RegMetrics

func (r *Prunner) RegMetrics(node *cluster.Snode)

NOTE: have only common metrics (see regCommon()) - init only the Prometheus part if used

func (*Prunner) Run

func (r *Prunner) Run() error

func (*Prunner) StartedUp

func (r *Prunner) StartedUp() bool

func (*Prunner) Stop

func (r *Prunner) Stop(err error)

type RebalanceSnap

type RebalanceSnap struct {
	xact.Snap
	RebID int64 `json:"glob.id,string"`
}

type Tracker

type Tracker interface {
	cos.StatsTracker

	StartedUp() bool
	AddErrorHTTP(method string, val int64)
	CoreStats() *CoreStats
	GetWhatStats() *DaemonStats
	RegMetrics(node *cluster.Snode)
	IsPrometheus() bool
}

type Trunner

type Trunner struct {
	T     cluster.Target `json:"-"`
	MPCap fs.MPCap       `json:"capacity"`
	// contains filtered or unexported fields
}

func (*Trunner) Add

func (r *Trunner) Add(name string, val int64)

common impl NOTE: currently, proxy's stats == common and hardcoded

func (*Trunner) AddErrorHTTP

func (r *Trunner) AddErrorHTTP(method string, val int64)

func (*Trunner) AddMany

func (r *Trunner) AddMany(nvs ...cos.NamedVal64)

func (*Trunner) Collect

func (r *Trunner) Collect(ch chan<- prometheus.Metric)

func (*Trunner) CoreStats

func (r *Trunner) CoreStats() *CoreStats

func (*Trunner) Describe

func (r *Trunner) Describe(ch chan<- *prometheus.Desc)

func (*Trunner) Get

func (r *Trunner) Get(name string) (val int64)

func (*Trunner) GetWhatStats

func (r *Trunner) GetWhatStats() (ds *DaemonStats)

func (*Trunner) Init

func (r *Trunner) Init(t cluster.Target) *atomic.Bool

func (*Trunner) InitCapacity

func (r *Trunner) InitCapacity() error

func (*Trunner) IsPrometheus

func (r *Trunner) IsPrometheus() bool

func (*Trunner) Name

func (r *Trunner) Name() string

func (*Trunner) RegDiskMetrics

func (r *Trunner) RegDiskMetrics(disk string)

func (*Trunner) RegMetrics

func (r *Trunner) RegMetrics(node *cluster.Snode)

func (*Trunner) Run

func (r *Trunner) Run() error

func (*Trunner) Standby

func (r *Trunner) Standby(v bool)

func (*Trunner) StartedUp

func (r *Trunner) StartedUp() bool

func (*Trunner) Stop

func (r *Trunner) Stop(err error)

Directories

Path Synopsis
Package statsd provides a client to send basic statd metrics (timer, counter and gauge) to listening UDP StatsD server.
Package statsd provides a client to send basic statd metrics (timer, counter and gauge) to listening UDP StatsD server.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL