Documentation ¶
Index ¶
- type Measurement
- func (m *Measurement) Count(n int)
- func (m *Measurement) Durations() []time.Duration
- func (m *Measurement) Gauge(value interface{})
- func (m *Measurement) Increment()
- func (m *Measurement) LastDuration() time.Duration
- func (m *Measurement) LastValue() float64
- func (m *Measurement) Observe(value float64)
- func (m *Measurement) RecordDuration() func()
- func (m *Measurement) SendTiming(duration time.Duration)
- func (m *Measurement) Since(start time.Time)
- func (m *Measurement) Values() []float64
- type Metric
- type Opts
- type Store
- func (ms *Store) Get(name string, tags stats.Tags) *Measurement
- func (ms *Store) GetAll() []Metric
- func (ms *Store) GetByName(name string) []Metric
- func (ms *Store) NewSampledTaggedStat(name, statType string, tags stats.Tags) stats.Measurement
- func (ms *Store) NewStat(name, statType string) (m stats.Measurement)
- func (ms *Store) NewTaggedStat(name, statType string, tags stats.Tags) stats.Measurement
- func (ms *Store) NewTracer(name string) stats.Tracer
- func (s *Store) RegisterCollector(c stats.Collector) error
- func (ms *Store) Spans() ([]tracemodel.Span, error)
- func (*Store) Start(_ context.Context, _ stats.GoRoutineFactory) error
- func (*Store) Stop()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Measurement ¶
type Measurement struct {
// contains filtered or unexported fields
}
func (*Measurement) Durations ¶
func (m *Measurement) Durations() []time.Duration
func (*Measurement) Gauge ¶
func (m *Measurement) Gauge(value interface{})
Gauge implements stats.Measurement
func (*Measurement) Increment ¶
func (m *Measurement) Increment()
Increment implements stats.Measurement
func (*Measurement) LastDuration ¶
func (m *Measurement) LastDuration() time.Duration
func (*Measurement) LastValue ¶
func (m *Measurement) LastValue() float64
func (*Measurement) Observe ¶
func (m *Measurement) Observe(value float64)
Observe implements stats.Measurement
func (*Measurement) RecordDuration ¶
func (m *Measurement) RecordDuration() func()
RecordDuration implements stats.Measurement
func (*Measurement) SendTiming ¶
func (m *Measurement) SendTiming(duration time.Duration)
SendTiming implements stats.Measurement
func (*Measurement) Since ¶
func (m *Measurement) Since(start time.Time)
Since implements stats.Measurement
func (*Measurement) Values ¶
func (m *Measurement) Values() []float64
type Metric ¶ added in v0.17.0
type Metric struct { Name string Tags stats.Tags Value float64 // Count, Gauge Values []float64 // Histogram Durations []time.Duration // Timer }
Metric captures the name, tags and value(s) depending on type.
For Count and Gauge, Value is used. For Histogram, Values is used. For Timer, Durations is used.
type Opts ¶
type Opts func(*Store)
func WithTracing ¶ added in v0.19.0
func WithTracing() Opts
func WithTracingTimestamps ¶ added in v0.19.0
func WithTracingTimestamps() Opts
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) Get ¶
func (ms *Store) Get(name string, tags stats.Tags) *Measurement
Get the stored measurement with the name and tags. If no measurement is found, nil is returned.
func (*Store) GetAll ¶ added in v0.17.0
GetAll returns the metric for all name/tags register in the store.
func (*Store) GetByName ¶ added in v0.17.0
GetByName returns the metric for each tag variation with the given name.
func (*Store) NewSampledTaggedStat ¶
NewSampledTaggedStat implements stats.Stats
func (*Store) NewStat ¶
func (ms *Store) NewStat(name, statType string) (m stats.Measurement)
NewStat implements stats.Stats
func (*Store) NewTaggedStat ¶
NewTaggedStat implements stats.Stats