Documentation ¶
Index ¶
- type Bin
- type Measurer
- type Metric
- func (m *Metric) Count() int
- func (m *Metric) Histogram(bins ...int) []Bin
- func (m *Metric) Max() int
- func (m *Metric) Mean() float64
- func (m *Metric) Min() int
- func (m *Metric) Name() string
- func (m *Metric) Quantile(quantiles ...float64) []float64
- func (m *Metric) Rate() float64
- func (m *Metric) Reset()
- func (m *Metric) Snapshot() *Snapshot
- func (m *Metric) StdDev() float64
- func (m *Metric) Tag() string
- func (m *Metric) Update(v int32)
- func (m *Metric) UpdateTag(tag string)
- func (m *Metric) Variance() float64
- func (m *Metric) Window() (time.Time, time.Time)
- type Monitor
- func (m *Monitor) Get(name string) *Metric
- func (m *Monitor) Measure(name string, value int32)
- func (m *Monitor) MeasureElapsed(name string, start time.Time)
- func (m *Monitor) MeasureRuntime()
- func (m *Monitor) Range(f func(*Metric) bool)
- func (m *Monitor) Snapshot() (out []byte)
- func (m *Monitor) Tag(name, tag string)
- type Noop
- type Snapshot
- func (s *Snapshot) Count() int
- func (s *Snapshot) Max() int
- func (s *Snapshot) Mean() float64
- func (s *Snapshot) Merge(other Snapshot)
- func (s *Snapshot) Min() int
- func (s *Snapshot) Name() string
- func (s *Snapshot) Quantile(quantiles ...float64) []float64
- func (s *Snapshot) Rate() float64
- func (s *Snapshot) StdDev() float64
- func (s *Snapshot) Sum() int
- func (s *Snapshot) Tag() string
- func (s *Snapshot) Variance() float64
- func (s *Snapshot) Window() (int64, int64)
- type Snapshots
- type Snapshotter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bin ¶ added in v1.0.2
type Bin struct { Lower int32 // The lower bound of the bin //Center int32 // The center of the bin Upper int32 // The upper bound of the bin Count int // The number of elements in the bin }
Bin represents a bin of a histogram
type Measurer ¶
type Measurer interface { Snapshotter Measure(name string, value int32) MeasureElapsed(name string, start time.Time) MeasureRuntime() Tag(name, tag string) }
Measurer represents a monitoring contract.
type Metric ¶
Metric maintains a combination of a gauge and a statistically-significant selection of the values from a stream. This is essentially a combination of a histogram, gauge and a counter.
func (*Metric) Count ¶
Count returns the number of samples recorded, which may exceed the reservoir size.
func (*Metric) Max ¶
Max returns the maximum value in the sample, which may not be the maximum value ever to be part of the sample.
func (*Metric) Min ¶
Min returns the minimum value in the sample, which may not be the minimum value ever to be part of the sample.
type Monitor ¶
type Monitor struct {
// contains filtered or unexported fields
}
Monitor represents a monitoring registry
func (*Monitor) Get ¶
Get retrieves a metric by its name. If the metric does not exist yet, it will create and register the metric.
func (*Monitor) MeasureElapsed ¶
MeasureElapsed measures elapsed time since the start
func (*Monitor) MeasureRuntime ¶
func (m *Monitor) MeasureRuntime()
MeasureRuntime captures the runtime metrics, this is a relatively slow process and code is largely inspired by go-metrics.
func (*Monitor) Range ¶ added in v1.0.3
Range ranges over all the metrics in the monitor. The iteration stops if the function returns false, similar to sync.Map
type Noop ¶
type Noop struct{}
Noop represents a no-op monitor
func (*Noop) MeasureElapsed ¶
MeasureElapsed measures elapsed time since the start
func (*Noop) MeasureRuntime ¶
func (m *Noop) MeasureRuntime()
MeasureRuntime measures the runtime information
type Snapshot ¶
Snapshot is a read-only copy of another Sample.
func (*Snapshot) StdDev ¶
StdDev returns the standard deviation of values at the time the snapshot was taken.
type Snapshots ¶
type Snapshots []Snapshot
Snapshots represents a set of snapshots.
type Snapshotter ¶
type Snapshotter interface {
Snapshot() []byte
}
Snapshotter represents a snapshotting contract.