Versions in this module Expand all Collapse all v1 v1.0.0 Nov 29, 2024 Changes in this version + var DefBuckets = []float64 + func ExponentialBuckets(start, factor float64, count int) []float64 + func ExponentialBucketsRange(minBucket, maxBucket float64, count int) []float64 + func ExposeMetadata(v bool) + func InitPush(pushURL string, interval time.Duration, extraLabels string, ...) error + func InitPushExt(pushURL string, interval time.Duration, extraLabels string, ...) error + func InitPushExtWithOptions(ctx context.Context, pushURL string, interval time.Duration, ...) error + func InitPushProcessMetrics(pushURL string, interval time.Duration, extraLabels string) error + func InitPushWithOptions(ctx context.Context, pushURL string, interval time.Duration, ...) error + func LinearBuckets(start, width float64, count int) []float64 + func ListMetricNames() []string + func PushMetrics(ctx context.Context, pushURL string, pushProcessMetrics bool, ...) error + func PushMetricsExt(ctx context.Context, pushURL string, writeMetrics func(w io.Writer), ...) error + func RegisterMetricsWriter(writeMetrics func(w io.Writer)) + func RegisterSet(s *Set) + func UnregisterAllMetrics() + func UnregisterMetric(name string) bool + func UnregisterSet(s *Set, destroySet bool) + func WriteCounterFloat64(w io.Writer, name string, value float64) + func WriteCounterUint64(w io.Writer, name string, value uint64) + func WriteFDMetrics(w io.Writer) + func WriteGaugeFloat64(w io.Writer, name string, value float64) + func WriteGaugeUint64(w io.Writer, name string, value uint64) + func WriteMetadataIfNeeded(w io.Writer, metricName, metricType string) + func WriteProcessMetrics(w io.Writer) + func WritePrometheus(w io.Writer, exposeProcessMetrics bool) + type Counter struct + func GetOrCreateCounter(name string) *Counter + func NewCounter(name string) *Counter + func (c *Counter) Add(n int) + func (c *Counter) AddInt64(n int64) + func (c *Counter) Dec() + func (c *Counter) Get() uint64 + func (c *Counter) Inc() + func (c *Counter) Set(n uint64) + type FloatCounter struct + func GetOrCreateFloatCounter(name string) *FloatCounter + func NewFloatCounter(name string) *FloatCounter + func (fc *FloatCounter) Add(n float64) + func (fc *FloatCounter) Get() float64 + func (fc *FloatCounter) Set(n float64) + func (fc *FloatCounter) Sub(n float64) + type Gauge struct + func GetOrCreateGauge(name string, f func() float64) *Gauge + func NewGauge(name string, f func() float64) *Gauge + func (g *Gauge) Add(fAdd float64) + func (g *Gauge) Dec() + func (g *Gauge) Get() float64 + func (g *Gauge) Inc() + func (g *Gauge) Set(v float64) + type Histogram struct + func GetOrCreateHistogram(name string) *Histogram + func NewHistogram(name string) *Histogram + func (h *Histogram) Merge(src *Histogram) + func (h *Histogram) Reset() + func (h *Histogram) Update(v float64) + func (h *Histogram) UpdateDuration(startTime time.Time) + func (h *Histogram) VisitNonZeroBuckets(f func(vmrange string, count uint64)) + type HistogramStatic struct + func GetOrCreateHistogramStatic(name string, buckets []float64) *HistogramStatic + func NewHistogramStatic(name string, buckets []float64) *HistogramStatic + func (h *HistogramStatic) Reset() + func (h *HistogramStatic) Update(v float64) + func (h *HistogramStatic) UpdateDuration(startTime time.Time) + func (h *HistogramStatic) VisitBuckets(f func(le string, count uint64)) + type PushOptions struct + DisableCompression bool + ExtraLabels string + Headers []string + Method string + WaitGroup *sync.WaitGroup + type Set struct + func GetDefaultSet() *Set + func NewSet() *Set + func (s *Set) GetOrCreateCounter(name string) *Counter + func (s *Set) GetOrCreateFloatCounter(name string) *FloatCounter + func (s *Set) GetOrCreateGauge(name string, f func() float64) *Gauge + func (s *Set) GetOrCreateHistogram(name string) *Histogram + func (s *Set) GetOrCreateHistogramStatic(name string, buckets []float64) *HistogramStatic + func (s *Set) GetOrCreateSummary(name string) *Summary + func (s *Set) GetOrCreateSummaryExt(name string, window time.Duration, quantiles []float64) *Summary + func (s *Set) InitPush(pushURL string, interval time.Duration, extraLabels string) error + func (s *Set) InitPushWithOptions(ctx context.Context, pushURL string, interval time.Duration, opts *PushOptions) error + func (s *Set) ListMetricNames() []string + func (s *Set) NewCounter(name string) *Counter + func (s *Set) NewFloatCounter(name string) *FloatCounter + func (s *Set) NewGauge(name string, f func() float64) *Gauge + func (s *Set) NewHistogram(name string) *Histogram + func (s *Set) NewHistogramStatic(name string, buckets []float64) *HistogramStatic + func (s *Set) NewSummary(name string) *Summary + func (s *Set) NewSummaryExt(name string, window time.Duration, quantiles []float64) *Summary + func (s *Set) PushMetrics(ctx context.Context, pushURL string, opts *PushOptions) error + func (s *Set) RegisterMetricsWriter(writeMetrics func(w io.Writer)) + func (s *Set) UnregisterAllMetrics() + func (s *Set) UnregisterMetric(name string) bool + func (s *Set) WritePrometheus(w io.Writer) + type Summary struct + func GetOrCreateSummary(name string) *Summary + func GetOrCreateSummaryExt(name string, window time.Duration, quantiles []float64) *Summary + func NewSummary(name string) *Summary + func NewSummaryExt(name string, window time.Duration, quantiles []float64) *Summary + func (sm *Summary) Update(v float64) + func (sm *Summary) UpdateDuration(startTime time.Time)