Versions in this module Expand all Collapse all v1 v1.0.0 Jan 16, 2024 Changes in this version + const InitialResettingTimerSliceCap + var AccountingRegistry = NewRegistry() + var DefaultConfig = Config + var DefaultRegistry = NewRegistry() + var Enabled = false + var EnabledExpensive = false + var EphemeralRegistry = NewRegistry() + func CalculatePercentiles(values []int64, ps []float64) []float64 + func CaptureDebugGCStats(r Registry, d time.Duration) + func CaptureDebugGCStatsOnce(r Registry) + func CollectProcessMetrics(refresh time.Duration) + func Each(f func(string, interface{})) + func Get(name string) interface + func GetOrRegister(name string, i interface{}) interface + func Graphite(r Registry, d time.Duration, prefix string, addr *net.TCPAddr) + func GraphiteOnce(c GraphiteConfig) error + func GraphiteWithConfig(c GraphiteConfig) + func Log(r Registry, freq time.Duration, l Logger) + func LogScaled(r Registry, freq time.Duration, scale time.Duration, l Logger) + func MustRegister(name string, i interface{}) + func OpenTSDB(r Registry, d time.Duration, prefix string, addr *net.TCPAddr) + func OpenTSDBWithConfig(c OpenTSDBConfig) + func ReadCPUStats(stats *CPUStats) + func ReadDiskStats(stats *DiskStats) error + func ReadRuntimeStats() *runtimeStats + func Register(name string, i interface{}) error + func RegisterDebugGCStats(r Registry) + func RunHealthchecks() + func RuntimeHistogramFromData(scale float64, hist *metrics.Float64Histogram) *runtimeHistogram + func SamplePercentile(values []int64, p float64) float64 + func SampleVariance(mean float64, values []int64) float64 + func Syslog(r Registry, d time.Duration, w *syslog.Writer) — darwin/amd64, js/wasm, linux/amd64 + func Unregister(name string) + func Write(r Registry, d time.Duration, w io.Writer) + func WriteJSON(r Registry, d time.Duration, w io.Writer) + func WriteJSONOnce(r Registry, w io.Writer) + func WriteOnce(r Registry, w io.Writer) + type CPUStats struct + GlobalTime float64 + GlobalWait float64 + LocalTime float64 + type Config struct + EnableInfluxDB bool + EnableInfluxDBV2 bool + Enabled bool + EnabledExpensive bool + HTTP string + InfluxDBBucket string + InfluxDBDatabase string + InfluxDBEndpoint string + InfluxDBOrganization string + InfluxDBPassword string + InfluxDBTags string + InfluxDBToken string + InfluxDBUsername string + Port int + type Counter interface + Clear func() + Dec func(int64) + Inc func(int64) + Snapshot func() CounterSnapshot + func GetOrRegisterCounter(name string, r Registry) Counter + func GetOrRegisterCounterForced(name string, r Registry) Counter + func NewCounter() Counter + func NewCounterForced() Counter + func NewRegisteredCounter(name string, r Registry) Counter + func NewRegisteredCounterForced(name string, r Registry) Counter + type CounterFloat64 interface + Clear func() + Dec func(float64) + Inc func(float64) + Snapshot func() CounterFloat64Snapshot + func GetOrRegisterCounterFloat64(name string, r Registry) CounterFloat64 + func GetOrRegisterCounterFloat64Forced(name string, r Registry) CounterFloat64 + func NewCounterFloat64() CounterFloat64 + func NewCounterFloat64Forced() CounterFloat64 + func NewRegisteredCounterFloat64(name string, r Registry) CounterFloat64 + func NewRegisteredCounterFloat64Forced(name string, r Registry) CounterFloat64 + type CounterFloat64Snapshot interface + Count func() float64 + type CounterSnapshot interface + Count func() int64 + type DiskStats struct + ReadBytes int64 + ReadCount int64 + WriteBytes int64 + WriteCount int64 + type DuplicateMetric string + func (err DuplicateMetric) Error() string + type EWMA interface + Snapshot func() EWMASnapshot + Tick func() + Update func(int64) + func NewEWMA(alpha float64) EWMA + func NewEWMA1() EWMA + func NewEWMA15() EWMA + func NewEWMA5() EWMA + type EWMASnapshot interface + Rate func() float64 + type ExpDecaySample struct + func (s *ExpDecaySample) Clear() + func (s *ExpDecaySample) SetRand(prng *rand.Rand) Sample + func (s *ExpDecaySample) Snapshot() SampleSnapshot + func (s *ExpDecaySample) Update(v int64) + type Gauge interface + Dec func(int64) + Inc func(int64) + Snapshot func() GaugeSnapshot + Update func(int64) + UpdateIfGt func(int64) + func GetOrRegisterGauge(name string, r Registry) Gauge + func NewGauge() Gauge + func NewRegisteredGauge(name string, r Registry) Gauge + type GaugeFloat64 interface + Snapshot func() GaugeFloat64Snapshot + Update func(float64) + func GetOrRegisterGaugeFloat64(name string, r Registry) GaugeFloat64 + func NewGaugeFloat64() GaugeFloat64 + func NewRegisteredGaugeFloat64(name string, r Registry) GaugeFloat64 + type GaugeFloat64Snapshot interface + Value func() float64 + type GaugeInfo interface + Snapshot func() GaugeInfoSnapshot + Update func(GaugeInfoValue) + func GetOrRegisterGaugeInfo(name string, r Registry) GaugeInfo + func NewGaugeInfo() GaugeInfo + func NewRegisteredGaugeInfo(name string, r Registry) GaugeInfo + type GaugeInfoSnapshot interface + Value func() GaugeInfoValue + type GaugeInfoValue map[string]string + func (val GaugeInfoValue) String() string + type GaugeSnapshot interface + Value func() int64 + type GraphiteConfig struct + Addr *net.TCPAddr + DurationUnit time.Duration + FlushInterval time.Duration + Percentiles []float64 + Prefix string + Registry Registry + type Healthcheck interface + Check func() + Error func() error + Healthy func() + Unhealthy func(error) + func NewHealthcheck(f func(Healthcheck)) Healthcheck + type Histogram interface + Clear func() + Snapshot func() HistogramSnapshot + Update func(int64) + func GetOrRegisterHistogram(name string, r Registry, s Sample) Histogram + func GetOrRegisterHistogramLazy(name string, r Registry, s func() Sample) Histogram + func NewHistogram(s Sample) Histogram + func NewRegisteredHistogram(name string, r Registry, s Sample) Histogram + type HistogramSnapshot interface + type Logger interface + Printf func(format string, v ...interface{}) + type Meter interface + Mark func(int64) + Snapshot func() MeterSnapshot + Stop func() + func GetOrRegisterMeter(name string, r Registry) Meter + func NewInactiveMeter() Meter + func NewMeter() Meter + func NewRegisteredMeter(name string, r Registry) Meter + type MeterSnapshot interface + Count func() int64 + Rate1 func() float64 + Rate15 func() float64 + Rate5 func() float64 + RateMean func() float64 + type NilCounter struct + func (NilCounter) Clear() + func (NilCounter) Dec(i int64) + func (NilCounter) Inc(i int64) + func (NilCounter) Snapshot() CounterSnapshot + type NilCounterFloat64 struct + func (NilCounterFloat64) Clear() + func (NilCounterFloat64) Count() float64 + func (NilCounterFloat64) Dec(i float64) + func (NilCounterFloat64) Inc(i float64) + func (NilCounterFloat64) Snapshot() CounterFloat64Snapshot + type NilEWMA struct + func (NilEWMA) Snapshot() EWMASnapshot + func (NilEWMA) Tick() + func (NilEWMA) Update(n int64) + type NilGauge struct + func (NilGauge) Dec(i int64) + func (NilGauge) Inc(i int64) + func (NilGauge) Snapshot() GaugeSnapshot + func (NilGauge) Update(v int64) + func (NilGauge) UpdateIfGt(v int64) + type NilGaugeFloat64 struct + func (NilGaugeFloat64) Snapshot() GaugeFloat64Snapshot + func (NilGaugeFloat64) Update(v float64) + func (NilGaugeFloat64) Value() float64 + type NilGaugeInfo struct + func (NilGaugeInfo) Snapshot() GaugeInfoSnapshot + func (NilGaugeInfo) Update(v GaugeInfoValue) + func (NilGaugeInfo) Value() GaugeInfoValue + type NilHealthcheck struct + func (NilHealthcheck) Check() + func (NilHealthcheck) Error() error + func (NilHealthcheck) Healthy() + func (NilHealthcheck) Unhealthy(error) + type NilHistogram struct + func (NilHistogram) Clear() + func (NilHistogram) Snapshot() HistogramSnapshot + func (NilHistogram) Update(v int64) + type NilMeter struct + func (NilMeter) Count() int64 + func (NilMeter) Mark(n int64) + func (NilMeter) Snapshot() MeterSnapshot + func (NilMeter) Stop() + type NilResettingTimer struct + func (NilResettingTimer) Count() int + func (NilResettingTimer) Max() int64 + func (NilResettingTimer) Mean() float64 + func (NilResettingTimer) Min() int64 + func (NilResettingTimer) Percentiles([]float64) []float64 + func (NilResettingTimer) Time(f func()) + func (NilResettingTimer) Update(time.Duration) + func (NilResettingTimer) UpdateSince(time.Time) + func (NilResettingTimer) Values() []int64 + func (n NilResettingTimer) Snapshot() ResettingTimerSnapshot + type NilSample struct + func (NilSample) Clear() + func (NilSample) Snapshot() SampleSnapshot + func (NilSample) Update(v int64) + type NilTimer struct + func (NilTimer) Snapshot() TimerSnapshot + func (NilTimer) Stop() + func (NilTimer) Time(f func()) + func (NilTimer) Update(time.Duration) + func (NilTimer) UpdateSince(time.Time) + type OpenTSDBConfig struct + Addr *net.TCPAddr + DurationUnit time.Duration + FlushInterval time.Duration + Prefix string + Registry Registry + type PrefixedRegistry struct + func (p *PrefixedRegistry) MarshalJSON() ([]byte, error) + func (r *PrefixedRegistry) Each(fn func(string, interface{})) + func (r *PrefixedRegistry) Get(name string) interface{} + func (r *PrefixedRegistry) GetAll() map[string]map[string]interface{} + func (r *PrefixedRegistry) GetOrRegister(name string, metric interface{}) interface{} + func (r *PrefixedRegistry) Register(name string, metric interface{}) error + func (r *PrefixedRegistry) RunHealthchecks() + func (r *PrefixedRegistry) Unregister(name string) + type Registry interface + Each func(func(string, interface{})) + Get func(string) interface{} + GetAll func() map[string]map[string]interface{} + GetOrRegister func(string, interface{}) interface{} + Register func(string, interface{}) error + RunHealthchecks func() + Unregister func(string) + func NewOrderedRegistry() Registry + func NewPrefixedChildRegistry(parent Registry, prefix string) Registry + func NewPrefixedRegistry(prefix string) Registry + func NewRegistry() Registry + type ResettingTimer interface + Snapshot func() ResettingTimerSnapshot + Time func(func()) + Update func(time.Duration) + UpdateSince func(time.Time) + func GetOrRegisterResettingTimer(name string, r Registry) ResettingTimer + func NewRegisteredResettingTimer(name string, r Registry) ResettingTimer + func NewResettingTimer() ResettingTimer + type ResettingTimerSnapshot interface + Count func() int + Max func() int64 + Mean func() float64 + Min func() int64 + Percentiles func([]float64) []float64 + type Sample interface + Clear func() + Snapshot func() SampleSnapshot + Update func(int64) + func NewExpDecaySample(reservoirSize int, alpha float64) Sample + func NewUniformSample(reservoirSize int) Sample + func ResettingSample(sample Sample) Sample + type SampleSnapshot interface + Count func() int64 + Max func() int64 + Mean func() float64 + Min func() int64 + Percentile func(float64) float64 + Percentiles func([]float64) []float64 + Size func() int + StdDev func() float64 + Sum func() int64 + Variance func() float64 + type StandardCounter atomic.Int64 + func (c *StandardCounter) Clear() + func (c *StandardCounter) Dec(i int64) + func (c *StandardCounter) Inc(i int64) + func (c *StandardCounter) Snapshot() CounterSnapshot + type StandardCounterFloat64 struct + func (c *StandardCounterFloat64) Clear() + func (c *StandardCounterFloat64) Dec(v float64) + func (c *StandardCounterFloat64) Inc(v float64) + func (c *StandardCounterFloat64) Snapshot() CounterFloat64Snapshot + type StandardEWMA struct + func (a *StandardEWMA) Snapshot() EWMASnapshot + func (a *StandardEWMA) Tick() + func (a *StandardEWMA) Update(n int64) + type StandardGauge struct + func (g *StandardGauge) Dec(i int64) + func (g *StandardGauge) Inc(i int64) + func (g *StandardGauge) Snapshot() GaugeSnapshot + func (g *StandardGauge) Update(v int64) + func (g *StandardGauge) UpdateIfGt(v int64) + type StandardGaugeFloat64 struct + func (g *StandardGaugeFloat64) Snapshot() GaugeFloat64Snapshot + func (g *StandardGaugeFloat64) Update(v float64) + type StandardGaugeInfo struct + func (g *StandardGaugeInfo) Snapshot() GaugeInfoSnapshot + func (g *StandardGaugeInfo) Update(v GaugeInfoValue) + type StandardHealthcheck struct + func (h *StandardHealthcheck) Check() + func (h *StandardHealthcheck) Error() error + func (h *StandardHealthcheck) Healthy() + func (h *StandardHealthcheck) Unhealthy(err error) + type StandardHistogram struct + func (h *StandardHistogram) Clear() + func (h *StandardHistogram) Snapshot() HistogramSnapshot + func (h *StandardHistogram) Update(v int64) + type StandardMeter struct + func (m *StandardMeter) Mark(n int64) + func (m *StandardMeter) Snapshot() MeterSnapshot + func (m *StandardMeter) Stop() + type StandardRegistry struct + func (r *StandardRegistry) Each(f func(string, interface{})) + func (r *StandardRegistry) Get(name string) interface{} + func (r *StandardRegistry) GetAll() map[string]map[string]interface{} + func (r *StandardRegistry) GetOrRegister(name string, i interface{}) interface{} + func (r *StandardRegistry) MarshalJSON() ([]byte, error) + func (r *StandardRegistry) Register(name string, i interface{}) error + func (r *StandardRegistry) RunHealthchecks() + func (r *StandardRegistry) Unregister(name string) + type StandardResettingTimer struct + func (t *StandardResettingTimer) Snapshot() ResettingTimerSnapshot + func (t *StandardResettingTimer) Time(f func()) + func (t *StandardResettingTimer) Update(d time.Duration) + func (t *StandardResettingTimer) UpdateSince(ts time.Time) + type StandardTimer struct + func (t *StandardTimer) Snapshot() TimerSnapshot + func (t *StandardTimer) Stop() + func (t *StandardTimer) Time(f func()) + func (t *StandardTimer) Update(d time.Duration) + func (t *StandardTimer) UpdateSince(ts time.Time) + type Stoppable interface + Stop func() + type Timer interface + Snapshot func() TimerSnapshot + Stop func() + Time func(func()) + Update func(time.Duration) + UpdateSince func(time.Time) + func GetOrRegisterTimer(name string, r Registry) Timer + func NewCustomTimer(h Histogram, m Meter) Timer + func NewRegisteredTimer(name string, r Registry) Timer + func NewTimer() Timer + type TimerSnapshot interface + type UniformSample struct + func (s *UniformSample) Clear() + func (s *UniformSample) SetRand(prng *rand.Rand) Sample + func (s *UniformSample) Snapshot() SampleSnapshot + func (s *UniformSample) Update(v int64)