Documentation
¶
Index ¶
- Variables
- type Counter
- type Gauge
- type Histogram
- type HistogramSnapshot
- type Metric
- type Registry
- func (r *Registry) Counter(name string) *Counter
- func (r *Registry) Gauge(name string) *Gauge
- func (r *Registry) Get(name string) (Metric, bool)
- func (r *Registry) Histogram(name string) *Histogram
- func (r *Registry) Names() []string
- func (r *Registry) Register(m Metric)
- func (r *Registry) Snapshot() map[string]any
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultLatencyBuckets = []time.Duration{ 10 * time.Microsecond, 100 * time.Microsecond, 500 * time.Microsecond, time.Millisecond, 5 * time.Millisecond, 10 * time.Millisecond, 50 * time.Millisecond, 100 * time.Millisecond, time.Second, }
Functions ¶
This section is empty.
Types ¶
type Counter ¶
type Counter struct {
// contains filtered or unexported fields
}
Counter is a monotonically increasing counter.
func NewCounter ¶
func (*Counter) SnapshotValue ¶
type Gauge ¶
type Gauge struct {
// contains filtered or unexported fields
}
Gauge is a settable signed value.
func (*Gauge) SnapshotValue ¶
type Histogram ¶
type Histogram struct {
// contains filtered or unexported fields
}
Histogram records the distribution of durations into fixed upper-bound buckets.
func (*Histogram) Percentile ¶
Percentile returns the approximate duration at quantile q (0..1).
func (*Histogram) Snapshot ¶
func (h *Histogram) Snapshot() HistogramSnapshot
func (*Histogram) SnapshotValue ¶
type HistogramSnapshot ¶
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry is a named collection of metrics.
func NewRegistry ¶
func NewRegistry() *Registry
func (*Registry) Histogram ¶
Histogram returns the Histogram by name, creating it with default buckets if absent. For custom buckets, build with NewHistogram and pass to Register.
Click to show internal directories.
Click to hide internal directories.