Merge remote-tracking branch 'getters/metrics'
This commit is contained in:
commit
808a6f9320
@ -85,6 +85,14 @@ func (h *Histogram) Reset() {
|
|||||||
h.mu.Unlock()
|
h.mu.Unlock()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (h *Histogram) GetSum() float64 {
|
||||||
|
return h.sum
|
||||||
|
}
|
||||||
|
|
||||||
|
func (h *Histogram) GetDecimalBuckets() [decimalBucketsCount]*[bucketsPerDecimal]uint64 {
|
||||||
|
return h.decimalBuckets
|
||||||
|
}
|
||||||
|
|
||||||
// Update updates h with v.
|
// Update updates h with v.
|
||||||
//
|
//
|
||||||
// Negative values and NaNs are ignored.
|
// Negative values and NaNs are ignored.
|
||||||
|
20
summary.go
20
summary.go
@ -31,6 +31,26 @@ type Summary struct {
|
|||||||
window time.Duration
|
window time.Duration
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s *Summary) GetSum() float64 {
|
||||||
|
return s.sum
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *Summary) GetCount() uint64 {
|
||||||
|
return s.count
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *Summary) GetTime() time.Duration {
|
||||||
|
return s.window
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *Summary) GetQuantiles() []float64 {
|
||||||
|
return s.quantiles
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *Summary) GetQuantileValues() []float64 {
|
||||||
|
return s.quantileValues
|
||||||
|
}
|
||||||
|
|
||||||
// NewSummary creates and returns new summary with the given name.
|
// NewSummary creates and returns new summary with the given name.
|
||||||
//
|
//
|
||||||
// name must be valid Prometheus-compatible metric with possible labels.
|
// name must be valid Prometheus-compatible metric with possible labels.
|
||||||
|
Loading…
Reference in New Issue
Block a user