|
@@ -4,6 +4,7 @@ package metrics
|
|
|
type Histogram interface {
|
|
type Histogram interface {
|
|
|
Clear()
|
|
Clear()
|
|
|
Count() int64
|
|
Count() int64
|
|
|
|
|
+ Sum() int64
|
|
|
Max() int64
|
|
Max() int64
|
|
|
Mean() float64
|
|
Mean() float64
|
|
|
Min() int64
|
|
Min() int64
|
|
@@ -58,6 +59,10 @@ func (*HistogramSnapshot) Clear() {
|
|
|
// taken.
|
|
// taken.
|
|
|
func (h *HistogramSnapshot) Count() int64 { return h.sample.Count() }
|
|
func (h *HistogramSnapshot) Count() int64 { return h.sample.Count() }
|
|
|
|
|
|
|
|
|
|
+// Sum returns the sum in the sample at the time the snapshot was
|
|
|
|
|
+// taken.
|
|
|
|
|
+func (h *HistogramSnapshot) Sum() int64 { return h.sample.Sum() }
|
|
|
|
|
+
|
|
|
// Max returns the maximum value in the sample at the time the snapshot was
|
|
// Max returns the maximum value in the sample at the time the snapshot was
|
|
|
// taken.
|
|
// taken.
|
|
|
func (h *HistogramSnapshot) Max() int64 { return h.sample.Max() }
|
|
func (h *HistogramSnapshot) Max() int64 { return h.sample.Max() }
|
|
@@ -109,6 +114,9 @@ func (NilHistogram) Clear() {}
|
|
|
// Count is a no-op.
|
|
// Count is a no-op.
|
|
|
func (NilHistogram) Count() int64 { return 0 }
|
|
func (NilHistogram) Count() int64 { return 0 }
|
|
|
|
|
|
|
|
|
|
+// Sum is a no-op.
|
|
|
|
|
+func (NilHistogram) Sum() int64 { return 0 }
|
|
|
|
|
+
|
|
|
// Max is a no-op.
|
|
// Max is a no-op.
|
|
|
func (NilHistogram) Max() int64 { return 0 }
|
|
func (NilHistogram) Max() int64 { return 0 }
|
|
|
|
|
|
|
@@ -154,6 +162,9 @@ func (h *StandardHistogram) Clear() { h.sample.Clear() }
|
|
|
// cleared.
|
|
// cleared.
|
|
|
func (h *StandardHistogram) Count() int64 { return h.sample.Count() }
|
|
func (h *StandardHistogram) Count() int64 { return h.sample.Count() }
|
|
|
|
|
|
|
|
|
|
+// Sum returns the sum in the sample.
|
|
|
|
|
+func (h *StandardHistogram) Sum() int64 { return h.sample.Sum() }
|
|
|
|
|
+
|
|
|
// Max returns the maximum value in the sample.
|
|
// Max returns the maximum value in the sample.
|
|
|
func (h *StandardHistogram) Max() int64 { return h.sample.Max() }
|
|
func (h *StandardHistogram) Max() int64 { return h.sample.Max() }
|
|
|
|
|
|