Versions in this module Expand all Collapse all v0 v0.0.1 Nov 9, 2024 Changes in this version + 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 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 GetOrCreateCompatibleHistogram(name string) *Histogram + func GetOrCreateHistogram(name string) *Histogram + func NewCompatibleHistogram(name string) *Histogram + func NewHistogram(name string) *Histogram + func (h *Histogram) GetDecimalBuckets() [decimalBucketsCount]*[bucketsPerDecimal]uint64 + func (h *Histogram) GetSum() float64 + 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 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) GetOrCreateCompatibleHistogram(name string) *Histogram + 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) 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) NewCompatibleHistogram(name string) *Histogram + 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) 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 (s *Summary) GetCount() uint64 + func (s *Summary) GetQuantileValues() []float64 + func (s *Summary) GetQuantiles() []float64 + func (s *Summary) GetSum() float64 + func (s *Summary) GetTime() time.Duration + func (sm *Summary) Update(v float64) + func (sm *Summary) UpdateDuration(startTime time.Time)