metrics

package
v0.25.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 5, 2019 License: AGPL-3.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Error defines the metrics chore errors class.
	Error = errs.Class("metrics chore error")
)

Functions

This section is empty.

Types

type Chore

type Chore struct {
	Loop sync2.Cycle

	Counter *Counter
	// contains filtered or unexported fields
}

Chore implements the metrics chore.

architecture: Chore

func NewChore

func NewChore(log *zap.Logger, config Config, loop *metainfo.Loop) *Chore

NewChore creates a new instance of the metrics chore.

func (*Chore) Close

func (chore *Chore) Close() error

Close closes metrics chore.

func (*Chore) Run

func (chore *Chore) Run(ctx context.Context) (err error)

Run starts the metrics chore.

type Config

type Config struct {
	ChoreInterval time.Duration `help:"the time between each metrics chore run" releaseDefault:"15m" devDefault:"15m"`
}

Config contains configurable values for metrics collection.

type Counter

type Counter struct {
	RemoteDependent int64
	Inline          int64
	Total           int64
}

Counter implements the metainfo loop observer interface for data science metrics collection.

architecture: Observer

func NewCounter

func NewCounter() *Counter

NewCounter instantiates a new counter to be subscribed to the metainfo loop.

func (*Counter) InlineSegment

func (counter *Counter) InlineSegment(ctx context.Context, path metainfo.ScopedPath, pointer *pb.Pointer) (err error)

InlineSegment returns nil because counter does not interact with inline segments this way for now.

func (*Counter) Object

func (counter *Counter) Object(ctx context.Context, path metainfo.ScopedPath, pointer *pb.Pointer) (err error)

Object increments counts for inline objects and remote dependent objects.

func (*Counter) RemoteSegment

func (counter *Counter) RemoteSegment(ctx context.Context, path metainfo.ScopedPath, pointer *pb.Pointer) (err error)

RemoteSegment returns nil because counter does not interact with remote segments this way for now.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL