Documentation ¶
Overview ¶
Package statter is a statistics collector with multiple reporters..
Index ¶
- Variables
- type Counter
- type Gauge
- type Histogram
- type HistogramReporter
- type Option
- type Reporter
- type Statter
- func (s *Statter) Close() error
- func (s *Statter) Counter(name string, tags ...Tag) *Counter
- func (s *Statter) FullName(name string) string
- func (s *Statter) Gauge(name string, tags ...Tag) *Gauge
- func (s *Statter) Histogram(name string, tags ...Tag) *Histogram
- func (s *Statter) Reporter() Reporter
- func (s *Statter) Timing(name string, tags ...Tag) *Timing
- func (s *Statter) With(prefix string, tags ...Tag) *Statter
- type Tag
- type Timing
- type TimingReporter
Examples ¶
Constants ¶
This section is empty.
Variables ¶
var DiscardReporter = discardReporter{}
DiscardReporter is a reporter that discards all stats.
Functions ¶
This section is empty.
Types ¶
type Counter ¶
type Counter struct {
// contains filtered or unexported fields
}
Counter implements a counter.
type Gauge ¶
type Gauge struct {
// contains filtered or unexported fields
}
Gauge implements a gauge.
type Histogram ¶
type Histogram struct {
// contains filtered or unexported fields
}
Histogram implements a histogram.
type HistogramReporter ¶
HistogramReporter represents a stats reporter that handles histograms.
type Option ¶
type Option func(*config)
Option represents a statter option function.
func WithPercentileSamples ¶
WithPercentileSamples sets the number of samples taken to calculate percentiles.
func WithPercentiles ¶
WithPercentiles sets the percentiles to calculate and report for aggregated histograms and timings.
func WithPrefix ¶ added in v2.3.3
WithPrefix sets the initial prefix on a statter.
func WithSeparator ¶
WithSeparator sets the key separator on a statter.
type Reporter ¶
type Reporter interface { Counter(name string, v int64, tags [][2]string) Gauge(name string, v float64, tags [][2]string) }
Reporter represents a stats reporter.
type Statter ¶
type Statter struct {
// contains filtered or unexported fields
}
Statter collects and reports stats.
func (*Statter) FullName ¶ added in v2.2.0
FullName returns the full name with prefix for the given name.
func (*Statter) Reporter ¶ added in v2.1.1
Reporter returns the stats reporter.
The reporter should not be used directly.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
internal
|
|
bytes
Package bytes implements performant bytes implementations.
|
Package bytes implements performant bytes implementations. |
stats
Package stats implements performant statistics implementations.
|
Package stats implements performant statistics implementations. |
reporter
|
|
l2met
Package l2met implements an l2met stats client.
|
Package l2met implements an l2met stats client. |
prometheus
Package prometheus implements an prometheus stats client.
|
Package prometheus implements an prometheus stats client. |
statsd
Package statsd implements an statsd client.
|
Package statsd implements an statsd client. |
victoriametrics
Package victoriametrics implements an victoria metrics stats reporter.
|
Package victoriametrics implements an victoria metrics stats reporter. |
Package runtime implements runtime stats collection convenience functions.
|
Package runtime implements runtime stats collection convenience functions. |
Package tags implements statter tags convenience functions.
|
Package tags implements statter tags convenience functions. |