Documentation ¶
Index ¶
Constants ¶
View Source
const ( CountType = "count" TimerType = "timer" GaugeType = "gauge" HistogramType = "histogram" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Counter ¶ added in v1.2.0
type Counter interface { Count(n int) Increment() }
Counter represents a counter metric
type Gauge ¶ added in v1.2.0
type Gauge interface {
Gauge(value interface{})
}
Gauge represents a gauge metric
type Histogram ¶ added in v1.2.0
type Histogram interface {
Observe(value float64)
}
Histogram represents a histogram metric
type Measurement ¶ added in v1.2.0
Measurement provides all stat measurement functions TODO: the API should not return a union of measurement methods, but rather a distinct type for each measurement type
type Option ¶ added in v1.7.0
type Option func(*statsConfig)
func WithServiceName ¶ added in v1.7.0
WithServiceName sets the service name for the stats service.
func WithServiceVersion ¶ added in v1.7.0
WithServiceVersion sets the service version for the stats service.
type Stats ¶ added in v0.1.10
type Stats interface { // NewStat creates a new Measurement with provided Name and Type NewStat(name, statType string) (m Measurement) // NewTaggedStat creates a new Measurement with provided Name, Type and Tags NewTaggedStat(name, statType string, tags Tags) Measurement // NewSampledTaggedStat creates a new Measurement with provided Name, Type and Tags // Deprecated: use NewTaggedStat instead NewSampledTaggedStat(name, statType string, tags Tags) Measurement // Start starts the stats service and the collection of periodic stats. Start(ctx context.Context) error // Stop stops the service and the collection of periodic stats. Stop() }
Stats manages stat Measurements
var Default Stats
Default is the default (singleton) Stats instance
Source Files ¶
Click to show internal directories.
Click to hide internal directories.