package sum
import "go.opentelemetry.io/otel/sdk/metric/aggregator/sum"
Index ¶
- type Aggregator
- func New(cnt int) []Aggregator
- func (c *Aggregator) Aggregation() aggregation.Aggregation
- func (c *Aggregator) Kind() aggregation.Kind
- func (c *Aggregator) Merge(oa export.Aggregator, desc *metric.Descriptor) error
- func (c *Aggregator) Subtract(opAgg, resAgg export.Aggregator, descriptor *metric.Descriptor) error
- func (c *Aggregator) Sum() (metric.Number, error)
- func (c *Aggregator) SynchronizedMove(oa export.Aggregator, _ *metric.Descriptor) error
- func (c *Aggregator) Update(_ context.Context, number metric.Number, desc *metric.Descriptor) error
Types ¶
type Aggregator ¶
type Aggregator struct {
// contains filtered or unexported fields
}
Aggregator aggregates counter events.
func New ¶
func New(cnt int) []Aggregator
New returns a new counter aggregator implemented by atomic operations. This aggregator implements the aggregation.Sum export interface.
func (*Aggregator) Aggregation ¶
func (c *Aggregator) Aggregation() aggregation.Aggregation
Aggregation returns an interface for reading the state of this aggregator.
func (*Aggregator) Kind ¶
func (c *Aggregator) Kind() aggregation.Kind
Kind returns aggregation.SumKind.
func (*Aggregator) Merge ¶
func (c *Aggregator) Merge(oa export.Aggregator, desc *metric.Descriptor) error
Merge combines two counters by adding their sums.
func (*Aggregator) Subtract ¶
func (c *Aggregator) Subtract(opAgg, resAgg export.Aggregator, descriptor *metric.Descriptor) error
func (*Aggregator) Sum ¶
func (c *Aggregator) Sum() (metric.Number, error)
Sum returns the last-checkpointed sum. This will never return an error.
func (*Aggregator) SynchronizedMove ¶
func (c *Aggregator) SynchronizedMove(oa export.Aggregator, _ *metric.Descriptor) error
SynchronizedMove atomically saves the current value into oa and resets the current sum to zero.
func (*Aggregator) Update ¶
func (c *Aggregator) Update(_ context.Context, number metric.Number, desc *metric.Descriptor) error
Update atomically adds to the current value.
Source Files ¶
sum.go
- Version
- v0.7.0
- Published
- Jun 26, 2020
- Platform
- linux/amd64
- Imports
- 5 packages
- Last checked
- 1 minute ago –
Tools for package owners.