Documentation ¶
Overview ¶
Package stats provides various structs for collecting stats
- Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved.
Package stats provides various structs for collecting stats
- Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved.
Index ¶
- func ResetMetricsGauges(c *statsd.Client)
- type BaseMetricAgg
- type HTTPReq
- func (s *HTTPReq) Add(size int64, delta time.Duration)
- func (s *HTTPReq) AddErr()
- func (s *HTTPReq) Aggregate(other HTTPReq)
- func (s *HTTPReq) AvgLatency() int64
- func (s *HTTPReq) MaxLatency() int64
- func (s *HTTPReq) MinLatency() int64
- func (s *HTTPReq) Start() time.Time
- func (s *HTTPReq) Throughput(start, end time.Time) int64
- func (s *HTTPReq) Total() int64
- func (s *HTTPReq) TotalBytes() int64
- func (s *HTTPReq) TotalErrs() int64
- type MetricAgg
- func (ma *MetricAgg) Add(size int64, lat time.Duration)
- func (ma *MetricAgg) AddErr()
- func (ma *MetricAgg) AddPending(pending int64)
- func (ma *MetricAgg) AvgLatency() float64
- func (ma *MetricAgg) Send(c *statsd.Client, mType string, general []statsd.Metric, genAggCnt int64)
- func (ma *MetricAgg) Throughput(end time.Time) int64
- type MetricConfigAgg
- type MetricLatAgg
- type MetricLatsAgg
- type Metrics
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ResetMetricsGauges ¶
Types ¶
type BaseMetricAgg ¶
type BaseMetricAgg struct {
// contains filtered or unexported fields
}
type HTTPReq ¶
type HTTPReq struct {
// contains filtered or unexported fields
}
HTTPReq is used for keeping track of http requests stats including number of ops, latency, throughput, etc. Assume single threaded access, it doesn't provide any locking on updates.
func NewHTTPReq ¶
NewHTTPReq returns a new stats object with given time as the starting point
func (*HTTPReq) AddErr ¶
func (s *HTTPReq) AddErr()
AddErr increases the number of failed count by 1
func (*HTTPReq) AvgLatency ¶
AvgLatency returns the avg latency in nano second.
func (*HTTPReq) MaxLatency ¶
MaxLatency returns the maximal latency in nano second.
func (*HTTPReq) MinLatency ¶
MinLatency returns the minimal latency in nano second.
func (*HTTPReq) Throughput ¶
Throughput returns throughput of requests (bytes/per second).
func (*HTTPReq) TotalBytes ¶
TotalBytes returns the total number of bytes by all requests.
type MetricAgg ¶
type MetricAgg struct { MetricLatAgg // contains filtered or unexported fields }
func (*MetricAgg) AddPending ¶
func (*MetricAgg) AvgLatency ¶
type MetricConfigAgg ¶
type MetricConfigAgg struct { BaseMetricAgg // contains filtered or unexported fields }
func (*MetricConfigAgg) Add ¶
func (mcg *MetricConfigAgg) Add(lat, _, _ time.Duration)
func (*MetricConfigAgg) Send ¶
func (mcg *MetricConfigAgg) Send(c *statsd.Client)
type MetricLatAgg ¶
type MetricLatAgg struct { BaseMetricAgg // contains filtered or unexported fields }
type MetricLatsAgg ¶
type MetricLatsAgg struct {
// contains filtered or unexported fields
}
type Metrics ¶
type Metrics struct { Put MetricAgg Get MetricAgg Config MetricConfigAgg PutLat MetricLatsAgg GetLat MetricLatsAgg }