luci: go.chromium.org/luci/common/tsmon/store Index | Files | Directories

package store

import "go.chromium.org/luci/common/tsmon/store"

Package store contains code for storing and retreiving metrics.

Index

Package Files

fake.go inmemory.go nil.go store.go

func IsNilStore Uses

func IsNilStore(s Store) bool

IsNilStore returns true if given Store is in fact nil-store.

type Fake Uses

type Fake struct {
    Cells []types.Cell
    DT    types.Target
}

Fake is a fake Store.

func (*Fake) DefaultTarget Uses

func (s *Fake) DefaultTarget() types.Target

DefaultTarget returns DT.

func (*Fake) Get Uses

func (s *Fake) Get(context.Context, types.Metric, time.Time, []interface{}) interface{}

Get does nothing.

func (*Fake) GetAll Uses

func (s *Fake) GetAll(context.Context) []types.Cell

GetAll returns the pre-set list of cells.

func (*Fake) Incr Uses

func (s *Fake) Incr(context.Context, types.Metric, time.Time, []interface{}, interface{})

Incr does nothing.

func (*Fake) Reset Uses

func (s *Fake) Reset(context.Context, types.Metric)

Reset does nothing.

func (*Fake) Set Uses

func (s *Fake) Set(context.Context, types.Metric, time.Time, []interface{}, interface{})

Set does nothing.

func (*Fake) SetDefaultTarget Uses

func (s *Fake) SetDefaultTarget(types.Target)

SetDefaultTarget does nothing.

type Store Uses

type Store interface {
    DefaultTarget() types.Target
    SetDefaultTarget(t types.Target)

    Get(c context.Context, m types.Metric, resetTime time.Time, fieldVals []interface{}) interface{}
    Set(c context.Context, m types.Metric, resetTime time.Time, fieldVals []interface{}, value interface{})
    Incr(c context.Context, m types.Metric, resetTime time.Time, fieldVals []interface{}, delta interface{})

    GetAll(c context.Context) []types.Cell

    Reset(c context.Context, m types.Metric)
}

A Store is responsible for handling all metric data.

func NewInMemory Uses

func NewInMemory(defaultTarget types.Target) Store

NewInMemory creates a new metric store that holds metric data in this process' memory.

func NewNilStore Uses

func NewNilStore() Store

NewNilStore creates a metric store that completely ignores all metrics.

It's setters are noop, and getters return nil.

Directories

PathSynopsis
storetestPackage storetest is imported exclusively by tests for Store implementations.

Package store imports 11 packages (graph) and is imported by 6 packages. Updated 2018-08-15. Refresh now. Tools for package owners.