Documentation ¶
Overview ¶
Package store contains code for storing and retrieving metrics.
Index ¶
- func IsNilStore(s Store) bool
- type Fake
- func (s *Fake) DefaultTarget() types.Target
- func (s *Fake) Del(context.Context, types.Metric, []any)
- func (s *Fake) Get(context.Context, types.Metric, []any) any
- func (s *Fake) GetAll(context.Context) []types.Cell
- func (s *Fake) Incr(context.Context, types.Metric, []any, any)
- func (s *Fake) Now(ctx context.Context) time.Time
- func (s *Fake) Reset(context.Context, types.Metric)
- func (s *Fake) Set(context.Context, types.Metric, []any, any)
- func (s *Fake) SetDefaultTarget(types.Target)
- type Store
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsNilStore ¶
IsNilStore returns true if given Store is in fact nil-store.
Types ¶
type Fake ¶
Fake is a fake Store.
func (*Fake) SetDefaultTarget ¶
SetDefaultTarget does nothing.
type Store ¶
type Store interface { DefaultTarget() types.Target SetDefaultTarget(t types.Target) Get(ctx context.Context, m types.Metric, fieldVals []any) any Set(ctx context.Context, m types.Metric, fieldVals []any, value any) Del(ctx context.Context, m types.Metric, fieldVals []any) Incr(ctx context.Context, m types.Metric, fieldVals []any, delta any) GetAll(ctx context.Context) []types.Cell Reset(ctx context.Context, m types.Metric) Now(ctx context.Context) time.Time }
A Store is responsible for handling all metric data.
func NewInMemory ¶
NewInMemory creates a new metric store that holds metric data in this process' memory.
func NewNilStore ¶
func NewNilStore() Store
NewNilStore creates a metric store that completely ignores all metrics.
It's setters are noop, and getters return nil.
Click to show internal directories.
Click to hide internal directories.