basic

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInconsistentState = fmt.Errorf("inconsistent processor state")
View Source
var ErrInvalidExporterKind = fmt.Errorf("invalid exporter kind")

Functions

This section is empty.

Types

type Processor

type Processor struct {
	export.ExportKindSelector
	export.AggregatorSelector
	// contains filtered or unexported fields
}

func New

func New(aselector export.AggregatorSelector, eselector export.ExportKindSelector) *Processor

New returns a basic Processor using the provided AggregatorSelector to select Aggregators. The ExportKindSelector is consulted to determine the kind(s) of exporter that will consume data, so that this Processor can prepare to compute Delta or Cumulative Aggregations as needed.

func (*Processor) CheckpointSet

func (b *Processor) CheckpointSet() export.CheckpointSet

CheckpointSet returns the associated CheckpointSet. Use the CheckpointSet Locker interface to synchronize access to this object. The CheckpointSet.ForEach() method cannot be called concurrently with Process().

func (*Processor) FinishCollection

func (b *Processor) FinishCollection() error

FinishCollection signals to the Processor that a complete collection has finished and that ForEach will be called to access the CheckpointSet.

func (*Processor) ForEach

func (b *Processor) ForEach(exporter export.ExportKindSelector, f func(export.Record) error) error

ForEach iterates through the CheckpointSet, passing an export.Record with the appropriate Cumulative or Delta aggregation to an exporter.

func (*Processor) Process

func (b *Processor) Process(accum export.Accumulation) error

Process implements export.Processor.

func (*Processor) StartCollection

func (b *Processor) StartCollection()

StartCollection signals to the Processor one or more Accumulators will begin calling Process() calls during collection.

Jump to

Keyboard shortcuts

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