metrics

package
v1.31.1 Latest Latest
Warning

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

Go to latest
Published: May 31, 2021 License: AGPL-3.0 Imports: 8 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")
)

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 *metaloop.Service) *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 {
}

Config contains configurable values for metrics collection.

type Counter

type Counter struct {
	ObjectCount     int64
	RemoteDependent int64
	// contains filtered or unexported fields
}

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) InlineObjectCount added in v1.26.2

func (counter *Counter) InlineObjectCount() int64

InlineObjectCount returns the count of objects that are inline only.

func (*Counter) InlineSegment

func (counter *Counter) InlineSegment(ctx context.Context, segment *metaloop.Segment) (err error)

InlineSegment increments the count for inline objects.

func (*Counter) LoopStarted added in v1.27.3

func (counter *Counter) LoopStarted(context.Context, metaloop.LoopInfo) (err error)

LoopStarted is called at each start of a loop.

func (*Counter) Object

func (counter *Counter) Object(ctx context.Context, object *metaloop.Object) (err error)

Object increments the count for total objects and for inline objects in case the object has no segments.

func (*Counter) RemoteSegment

func (counter *Counter) RemoteSegment(ctx context.Context, segment *metaloop.Segment) (err error)

RemoteSegment increments the count for objects with remote segments.

Jump to

Keyboard shortcuts

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