Versions in this module Expand all Collapse all v1 v1.0.1 Apr 8, 2019 Changes in this version + const DashboardEnabledFlag + const InitialResettingTimerSliceCap + const MetricsEnabledFlag + var Enabled bool = false + func CaptureDebugGCStats(r Registry, d time.Duration) + func CaptureDebugGCStatsOnce(r Registry) + func CaptureRuntimeMemStats(r Registry, d time.Duration) + func CaptureRuntimeMemStatsOnce(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 ReadDiskStats(stats *DiskStats) error + func Register(name string, i interface{}) error + func RegisterDebugGCStats(r Registry) + func RegisterRuntimeMemStats(r Registry) + func RunHealthchecks() + func SampleMax(values []int64) int64 + func SampleMean(values []int64) float64 + func SampleMin(values []int64) int64 + func SamplePercentile(values int64Slice, p float64) float64 + func SamplePercentiles(values int64Slice, ps []float64) []float64 + func SampleStdDev(values []int64) float64 + func SampleSum(values []int64) int64 + func SampleVariance(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 Counter interface + Clear func() + Count func() int64 + Dec func(int64) + Inc func(int64) + Snapshot func() Counter + func GetOrRegisterCounter(name string, r Registry) Counter + func NewCounter() Counter + func NewRegisteredCounter(name string, r Registry) Counter + type CounterSnapshot int64 + func (CounterSnapshot) Clear() + func (CounterSnapshot) Dec(int64) + func (CounterSnapshot) Inc(int64) + func (c CounterSnapshot) Count() int64 + func (c CounterSnapshot) Snapshot() Counter + type DiskStats struct + ReadBytes int64 + ReadCount int64 + WriteBytes int64 + WriteCount int64 + type DuplicateMetric string + func (err DuplicateMetric) Error() string + type EWMA interface + Rate func() float64 + Snapshot func() EWMA + Tick func() + Update func(int64) + func NewEWMA(alpha float64) EWMA + func NewEWMA1() EWMA + func NewEWMA15() EWMA + func NewEWMA5() EWMA + type EWMASnapshot float64 + func (EWMASnapshot) Tick() + func (EWMASnapshot) Update(int64) + func (a EWMASnapshot) Rate() float64 + func (a EWMASnapshot) Snapshot() EWMA + type ExpDecaySample struct + func (s *ExpDecaySample) Clear() + func (s *ExpDecaySample) Count() int64 + func (s *ExpDecaySample) Max() int64 + func (s *ExpDecaySample) Mean() float64 + func (s *ExpDecaySample) Min() int64 + func (s *ExpDecaySample) Percentile(p float64) float64 + func (s *ExpDecaySample) Percentiles(ps []float64) []float64 + func (s *ExpDecaySample) Size() int + func (s *ExpDecaySample) Snapshot() Sample + func (s *ExpDecaySample) StdDev() float64 + func (s *ExpDecaySample) Sum() int64 + func (s *ExpDecaySample) Update(v int64) + func (s *ExpDecaySample) Values() []int64 + func (s *ExpDecaySample) Variance() float64 + type FunctionalGauge struct + func (FunctionalGauge) Update(int64) + func (g FunctionalGauge) Snapshot() Gauge + func (g FunctionalGauge) Value() int64 + type FunctionalGaugeFloat64 struct + func (FunctionalGaugeFloat64) Update(float64) + func (g FunctionalGaugeFloat64) Snapshot() GaugeFloat64 + func (g FunctionalGaugeFloat64) Value() float64 + type Gauge interface + Snapshot func() Gauge + Update func(int64) + Value func() int64 + func GetOrRegisterGauge(name string, r Registry) Gauge + func NewFunctionalGauge(f func() int64) Gauge + func NewGauge() Gauge + func NewRegisteredFunctionalGauge(name string, r Registry, f func() int64) Gauge + func NewRegisteredGauge(name string, r Registry) Gauge + type GaugeFloat64 interface + Snapshot func() GaugeFloat64 + Update func(float64) + Value func() float64 + func GetOrRegisterGaugeFloat64(name string, r Registry) GaugeFloat64 + func NewFunctionalGaugeFloat64(f func() float64) GaugeFloat64 + func NewGaugeFloat64() GaugeFloat64 + func NewRegisteredFunctionalGaugeFloat64(name string, r Registry, f func() float64) GaugeFloat64 + func NewRegisteredGaugeFloat64(name string, r Registry) GaugeFloat64 + type GaugeFloat64Snapshot float64 + func (GaugeFloat64Snapshot) Update(float64) + func (g GaugeFloat64Snapshot) Snapshot() GaugeFloat64 + func (g GaugeFloat64Snapshot) Value() float64 + type GaugeSnapshot int64 + func (GaugeSnapshot) Update(int64) + func (g GaugeSnapshot) Snapshot() Gauge + func (g GaugeSnapshot) Value() 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() + Count func() int64 + Max func() int64 + Mean func() float64 + Min func() int64 + Percentile func(float64) float64 + Percentiles func([]float64) []float64 + Sample func() Sample + Snapshot func() Histogram + StdDev func() float64 + Sum func() int64 + Update func(int64) + Variance func() float64 + func GetOrRegisterHistogram(name string, r Registry, s Sample) Histogram + func NewHistogram(s Sample) Histogram + func NewRegisteredHistogram(name string, r Registry, s Sample) Histogram + type HistogramSnapshot struct + func (*HistogramSnapshot) Clear() + func (*HistogramSnapshot) Update(int64) + func (h *HistogramSnapshot) Count() int64 + func (h *HistogramSnapshot) Max() int64 + func (h *HistogramSnapshot) Mean() float64 + func (h *HistogramSnapshot) Min() int64 + func (h *HistogramSnapshot) Percentile(p float64) float64 + func (h *HistogramSnapshot) Percentiles(ps []float64) []float64 + func (h *HistogramSnapshot) Sample() Sample + func (h *HistogramSnapshot) Snapshot() Histogram + func (h *HistogramSnapshot) StdDev() float64 + func (h *HistogramSnapshot) Sum() int64 + func (h *HistogramSnapshot) Variance() float64 + type Int64Slice []int64 + func (s Int64Slice) Len() int + func (s Int64Slice) Less(i, j int) bool + func (s Int64Slice) Swap(i, j int) + type Logger interface + Printf func(format string, v ...interface{}) + type Meter interface + Count func() int64 + Mark func(int64) + Rate1 func() float64 + Rate15 func() float64 + Rate5 func() float64 + RateMean func() float64 + Snapshot func() Meter + Stop func() + func GetOrRegisterMeter(name string, r Registry) Meter + func NewMeter() Meter + func NewRegisteredMeter(name string, r Registry) Meter + type MeterSnapshot struct + func (*MeterSnapshot) Mark(n int64) + func (m *MeterSnapshot) Count() int64 + func (m *MeterSnapshot) Rate1() float64 + func (m *MeterSnapshot) Rate15() float64 + func (m *MeterSnapshot) Rate5() float64 + func (m *MeterSnapshot) RateMean() float64 + func (m *MeterSnapshot) Snapshot() Meter + func (m *MeterSnapshot) Stop() + type NilCounter struct + func (NilCounter) Clear() + func (NilCounter) Count() int64 + func (NilCounter) Dec(i int64) + func (NilCounter) Inc(i int64) + func (NilCounter) Snapshot() Counter + type NilEWMA struct + func (NilEWMA) Rate() float64 + func (NilEWMA) Snapshot() EWMA + func (NilEWMA) Tick() + func (NilEWMA) Update(n int64) + type NilGauge struct + func (NilGauge) Snapshot() Gauge + func (NilGauge) Update(v int64) + func (NilGauge) Value() int64 + type NilGaugeFloat64 struct + func (NilGaugeFloat64) Snapshot() GaugeFloat64 + func (NilGaugeFloat64) Update(v float64) + func (NilGaugeFloat64) Value() float64 + 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) Count() int64 + func (NilHistogram) Max() int64 + func (NilHistogram) Mean() float64 + func (NilHistogram) Min() int64 + func (NilHistogram) Percentile(p float64) float64 + func (NilHistogram) Percentiles(ps []float64) []float64 + func (NilHistogram) Sample() Sample + func (NilHistogram) Snapshot() Histogram + func (NilHistogram) StdDev() float64 + func (NilHistogram) Sum() int64 + func (NilHistogram) Update(v int64) + func (NilHistogram) Variance() float64 + type NilMeter struct + func (NilMeter) Count() int64 + func (NilMeter) Mark(n int64) + func (NilMeter) Rate1() float64 + func (NilMeter) Rate15() float64 + func (NilMeter) Rate5() float64 + func (NilMeter) RateMean() float64 + func (NilMeter) Snapshot() Meter + func (NilMeter) Stop() + type NilResettingTimer struct + func (NilResettingTimer) Mean() float64 + func (NilResettingTimer) Percentiles([]float64) []int64 + func (NilResettingTimer) Snapshot() ResettingTimer + func (NilResettingTimer) Time(func()) + func (NilResettingTimer) Update(time.Duration) + func (NilResettingTimer) UpdateSince(time.Time) + func (NilResettingTimer) Values() []int64 + type NilSample struct + func (NilSample) Clear() + func (NilSample) Count() int64 + func (NilSample) Max() int64 + func (NilSample) Mean() float64 + func (NilSample) Min() int64 + func (NilSample) Percentile(p float64) float64 + func (NilSample) Percentiles(ps []float64) []float64 + func (NilSample) Size() int + func (NilSample) Snapshot() Sample + func (NilSample) StdDev() float64 + func (NilSample) Sum() int64 + func (NilSample) Update(v int64) + func (NilSample) Values() []int64 + func (NilSample) Variance() float64 + type NilTimer struct + func (NilTimer) Count() int64 + func (NilTimer) Max() int64 + func (NilTimer) Mean() float64 + func (NilTimer) Min() int64 + func (NilTimer) Percentile(p float64) float64 + func (NilTimer) Percentiles(ps []float64) []float64 + func (NilTimer) Rate1() float64 + func (NilTimer) Rate15() float64 + func (NilTimer) Rate5() float64 + func (NilTimer) RateMean() float64 + func (NilTimer) Snapshot() Timer + func (NilTimer) StdDev() float64 + func (NilTimer) Stop() + func (NilTimer) Sum() int64 + func (NilTimer) Time(func()) + func (NilTimer) Update(time.Duration) + func (NilTimer) UpdateSince(time.Time) + func (NilTimer) Variance() float64 + 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) + func (r *PrefixedRegistry) UnregisterAll() + 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) + UnregisterAll func() + var DefaultRegistry Registry = NewRegistry() + func NewPrefixedChildRegistry(parent Registry, prefix string) Registry + func NewPrefixedRegistry(prefix string) Registry + func NewRegistry() Registry + type ResettingTimer interface + Mean func() float64 + Percentiles func([]float64) []int64 + Snapshot func() ResettingTimer + Time func(func()) + Update func(time.Duration) + UpdateSince func(time.Time) + Values func() []int64 + func GetOrRegisterResettingTimer(name string, r Registry) ResettingTimer + func NewRegisteredResettingTimer(name string, r Registry) ResettingTimer + func NewResettingTimer() ResettingTimer + type ResettingTimerSnapshot struct + func (*ResettingTimerSnapshot) Time(func()) + func (*ResettingTimerSnapshot) Update(time.Duration) + func (*ResettingTimerSnapshot) UpdateSince(time.Time) + func (t *ResettingTimerSnapshot) Mean() float64 + func (t *ResettingTimerSnapshot) Percentiles(percentiles []float64) []int64 + func (t *ResettingTimerSnapshot) Snapshot() ResettingTimer + func (t *ResettingTimerSnapshot) Values() []int64 + type Sample interface + Clear func() + Count func() int64 + Max func() int64 + Mean func() float64 + Min func() int64 + Percentile func(float64) float64 + Percentiles func([]float64) []float64 + Size func() int + Snapshot func() Sample + StdDev func() float64 + Sum func() int64 + Update func(int64) + Values func() []int64 + Variance func() float64 + func NewExpDecaySample(reservoirSize int, alpha float64) Sample + func NewUniformSample(reservoirSize int) Sample + type SampleSnapshot struct + func NewSampleSnapshot(count int64, values []int64) *SampleSnapshot + func (*SampleSnapshot) Clear() + func (*SampleSnapshot) Update(int64) + func (s *SampleSnapshot) Count() int64 + func (s *SampleSnapshot) Max() int64 + func (s *SampleSnapshot) Mean() float64 + func (s *SampleSnapshot) Min() int64 + func (s *SampleSnapshot) Percentile(p float64) float64 + func (s *SampleSnapshot) Percentiles(ps []float64) []float64 + func (s *SampleSnapshot) Size() int + func (s *SampleSnapshot) Snapshot() Sample + func (s *SampleSnapshot) StdDev() float64 + func (s *SampleSnapshot) Sum() int64 + func (s *SampleSnapshot) Values() []int64 + func (s *SampleSnapshot) Variance() float64 + type StandardCounter struct + func (c *StandardCounter) Clear() + func (c *StandardCounter) Count() int64 + func (c *StandardCounter) Dec(i int64) + func (c *StandardCounter) Inc(i int64) + func (c *StandardCounter) Snapshot() Counter + type StandardEWMA struct + func (a *StandardEWMA) Rate() float64 + func (a *StandardEWMA) Snapshot() EWMA + func (a *StandardEWMA) Tick() + func (a *StandardEWMA) Update(n int64) + type StandardGauge struct + func (g *StandardGauge) Snapshot() Gauge + func (g *StandardGauge) Update(v int64) + func (g *StandardGauge) Value() int64 + type StandardGaugeFloat64 struct + func (g *StandardGaugeFloat64) Snapshot() GaugeFloat64 + func (g *StandardGaugeFloat64) Update(v float64) + func (g *StandardGaugeFloat64) Value() float64 + 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) Count() int64 + func (h *StandardHistogram) Max() int64 + func (h *StandardHistogram) Mean() float64 + func (h *StandardHistogram) Min() int64 + func (h *StandardHistogram) Percentile(p float64) float64 + func (h *StandardHistogram) Percentiles(ps []float64) []float64 + func (h *StandardHistogram) Sample() Sample + func (h *StandardHistogram) Snapshot() Histogram + func (h *StandardHistogram) StdDev() float64 + func (h *StandardHistogram) Sum() int64 + func (h *StandardHistogram) Update(v int64) + func (h *StandardHistogram) Variance() float64 + type StandardMeter struct + func (m *StandardMeter) Count() int64 + func (m *StandardMeter) Mark(n int64) + func (m *StandardMeter) Rate1() float64 + func (m *StandardMeter) Rate15() float64 + func (m *StandardMeter) Rate5() float64 + func (m *StandardMeter) RateMean() float64 + func (m *StandardMeter) Snapshot() Meter + 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) + func (r *StandardRegistry) UnregisterAll() + type StandardResettingTimer struct + func (t *StandardResettingTimer) Mean() float64 + func (t *StandardResettingTimer) Percentiles([]float64) []int64 + func (t *StandardResettingTimer) Snapshot() ResettingTimer + func (t *StandardResettingTimer) Time(f func()) + func (t *StandardResettingTimer) Update(d time.Duration) + func (t *StandardResettingTimer) UpdateSince(ts time.Time) + func (t *StandardResettingTimer) Values() []int64 + type StandardTimer struct + func (t *StandardTimer) Count() int64 + func (t *StandardTimer) Max() int64 + func (t *StandardTimer) Mean() float64 + func (t *StandardTimer) Min() int64 + func (t *StandardTimer) Percentile(p float64) float64 + func (t *StandardTimer) Percentiles(ps []float64) []float64 + func (t *StandardTimer) Rate1() float64 + func (t *StandardTimer) Rate15() float64 + func (t *StandardTimer) Rate5() float64 + func (t *StandardTimer) RateMean() float64 + func (t *StandardTimer) Snapshot() Timer + func (t *StandardTimer) StdDev() float64 + func (t *StandardTimer) Stop() + func (t *StandardTimer) Sum() int64 + func (t *StandardTimer) Time(f func()) + func (t *StandardTimer) Update(d time.Duration) + func (t *StandardTimer) UpdateSince(ts time.Time) + func (t *StandardTimer) Variance() float64 + type Stoppable interface + Stop func() + type Timer interface + Count func() int64 + Max func() int64 + Mean func() float64 + Min func() int64 + Percentile func(float64) float64 + Percentiles func([]float64) []float64 + Rate1 func() float64 + Rate15 func() float64 + Rate5 func() float64 + RateMean func() float64 + Snapshot func() Timer + StdDev func() float64 + Stop func() + Sum func() int64 + Time func(func()) + Update func(time.Duration) + UpdateSince func(time.Time) + Variance func() float64 + 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 struct + func (*TimerSnapshot) Time(func()) + func (*TimerSnapshot) Update(time.Duration) + func (*TimerSnapshot) UpdateSince(time.Time) + func (t *TimerSnapshot) Count() int64 + func (t *TimerSnapshot) Max() int64 + func (t *TimerSnapshot) Mean() float64 + func (t *TimerSnapshot) Min() int64 + func (t *TimerSnapshot) Percentile(p float64) float64 + func (t *TimerSnapshot) Percentiles(ps []float64) []float64 + func (t *TimerSnapshot) Rate1() float64 + func (t *TimerSnapshot) Rate15() float64 + func (t *TimerSnapshot) Rate5() float64 + func (t *TimerSnapshot) RateMean() float64 + func (t *TimerSnapshot) Snapshot() Timer + func (t *TimerSnapshot) StdDev() float64 + func (t *TimerSnapshot) Stop() + func (t *TimerSnapshot) Sum() int64 + func (t *TimerSnapshot) Variance() float64 + type UniformSample struct + func (s *UniformSample) Clear() + func (s *UniformSample) Count() int64 + func (s *UniformSample) Max() int64 + func (s *UniformSample) Mean() float64 + func (s *UniformSample) Min() int64 + func (s *UniformSample) Percentile(p float64) float64 + func (s *UniformSample) Percentiles(ps []float64) []float64 + func (s *UniformSample) Size() int + func (s *UniformSample) Snapshot() Sample + func (s *UniformSample) StdDev() float64 + func (s *UniformSample) Sum() int64 + func (s *UniformSample) Update(v int64) + func (s *UniformSample) Values() []int64 + func (s *UniformSample) Variance() float64