Documentation ¶
Overview ¶
Package histogram implements a basic histogram to keep track of data distribution.
Index ¶
- type Histogram
- func (h *Histogram) Add(value int64) error
- func (h *Histogram) Delta10m() stats.HistogramValue
- func (h *Histogram) Delta1h() stats.HistogramValue
- func (h *Histogram) Delta1m() stats.HistogramValue
- func (h *Histogram) LastUpdate() time.Time
- func (h *Histogram) Opts() Options
- func (h *Histogram) Value() stats.HistogramValue
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Histogram ¶
type Histogram struct {
// contains filtered or unexported fields
}
A Histogram accumulates values in the form of a histogram. The type of the values is int64, which is suitable for keeping track of things like RPC latency in milliseconds. New histogram objects should be obtained via the New() function.
func New ¶
New returns a pointer to a new Histogram object that was created with the provided options.
func (*Histogram) Delta10m ¶
func (h *Histogram) Delta10m() stats.HistogramValue
Delta10m returns the change in the last 10 minutes.
func (*Histogram) Delta1h ¶
func (h *Histogram) Delta1h() stats.HistogramValue
Delta1h returns the change in the last hour.
func (*Histogram) Delta1m ¶
func (h *Histogram) Delta1m() stats.HistogramValue
Delta1m returns the change in the last 10 minutes.
func (*Histogram) LastUpdate ¶
LastUpdate returns the time at which the object was last updated.
func (*Histogram) Value ¶
func (h *Histogram) Value() stats.HistogramValue
Value returns the accumulated state of the histogram since it was created.
type Options ¶
type Options struct { // NumBuckets is the number of buckets. NumBuckets int // GrowthFactor is the growth factor of the buckets. A value of 0.1 // indicates that bucket N+1 will be 10% larger than bucket N. GrowthFactor float64 // SmallestBucketSize is the size of the first bucket. Bucket sizes are // rounded down to the nearest integer. SmallestBucketSize float64 // MinValue is the lower bound of the first bucket. MinValue int64 }
Options contains the parameters that define the histogram's buckets.