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
- func IsKindThroughput(name string) bool
- type ClusterStats
- type ClusterStatsRaw
- type CoreStats
- type DaemonStats
- type DaemonStatus
- type DaemonStatusMap
- type Prunner
- func (r *Prunner) Add(name string, val int64)
- func (r *Prunner) AddErrorHTTP(method string, val int64)
- func (r *Prunner) AddMany(nvs ...cos.NamedVal64)
- func (r *Prunner) Collect(ch chan<- prometheus.Metric)
- func (r *Prunner) CoreStats() *CoreStats
- func (r *Prunner) Describe(ch chan<- *prometheus.Desc)
- func (r *Prunner) Get(name string) (val int64)
- func (r *Prunner) GetWhatStats() *DaemonStats
- func (r *Prunner) Init(p cluster.Node) *atomic.Bool
- func (r *Prunner) IsPrometheus() bool
- func (r *Prunner) Name() string
- func (r *Prunner) RegMetrics(node *cluster.Snode)
- func (r *Prunner) Run() error
- func (r *Prunner) StartedUp() bool
- func (r *Prunner) Stop(err error)
- type RebalanceSnap
- type Tracker
- type Trunner
- func (r *Trunner) Add(name string, val int64)
- func (r *Trunner) AddErrorHTTP(method string, val int64)
- func (r *Trunner) AddMany(nvs ...cos.NamedVal64)
- func (r *Trunner) Collect(ch chan<- prometheus.Metric)
- func (r *Trunner) CoreStats() *CoreStats
- func (r *Trunner) Describe(ch chan<- *prometheus.Desc)
- func (r *Trunner) Get(name string) (val int64)
- func (r *Trunner) GetWhatStats() (ds *DaemonStats)
- func (r *Trunner) Init(t cluster.Target) *atomic.Bool
- func (r *Trunner) InitCapacity() error
- func (r *Trunner) IsPrometheus() bool
- func (r *Trunner) Name() string
- func (r *Trunner) RegDiskMetrics(disk string)
- func (r *Trunner) RegMetrics(node *cluster.Snode)
- func (r *Trunner) Run() error
- func (r *Trunner) Standby(v bool)
- func (r *Trunner) StartedUp() bool
- func (r *Trunner) Stop(err error)
Constants ¶
const ( KindCounter = "counter" KindGauge = "gauge" // + semantics KindLatency = "latency" KindThroughput = "bw" // currently, only GetThroughput - see NOTE below KindComputedThroughput = "compbw" // disk(s) read/write throughputs KindSpecial = "special" )
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
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 ¶
func IsKindThroughput ¶ added in v1.3.13
NOTE:
What's reported by api.GetClusterStats and api.GetDaemonStats is the cumulative byte number. It is the client's own responsibility to compute the actual throughput as only the client knows when exactly it was querying the previous time.
Also, compare with copyT() below that runs periodically and is used to log statistics.
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 (*CoreStats) UnmarshalJSON ¶
type DaemonStats ¶
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) AddErrorHTTP ¶
func (*Prunner) AddMany ¶
func (r *Prunner) AddMany(nvs ...cos.NamedVal64)
func (*Prunner) Collect ¶
func (r *Prunner) Collect(ch chan<- prometheus.Metric)
func (*Prunner) Describe ¶
func (r *Prunner) Describe(ch chan<- *prometheus.Desc)
func (*Prunner) GetWhatStats ¶
func (r *Prunner) GetWhatStats() *DaemonStats
func (*Prunner) Init ¶
All stats that proxy currently has are CoreStats which are registered at startup
func (*Prunner) IsPrometheus ¶
func (r *Prunner) IsPrometheus() bool
func (*Prunner) RegMetrics ¶
NOTE: have only common metrics (see regCommon()) - init only the Prometheus part if used
type RebalanceSnap ¶
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) AddErrorHTTP ¶
func (*Trunner) AddMany ¶
func (r *Trunner) AddMany(nvs ...cos.NamedVal64)
func (*Trunner) Collect ¶
func (r *Trunner) Collect(ch chan<- prometheus.Metric)
func (*Trunner) Describe ¶
func (r *Trunner) Describe(ch chan<- *prometheus.Desc)
func (*Trunner) GetWhatStats ¶
func (r *Trunner) GetWhatStats() (ds *DaemonStats)
func (*Trunner) InitCapacity ¶
func (*Trunner) IsPrometheus ¶
func (r *Trunner) IsPrometheus() bool