package minmaxsumcount
import "go.opentelemetry.io/otel/sdk/metric/aggregator/minmaxsumcount"
Index ¶
- type Aggregator
- func New(desc *metric.Descriptor) *Aggregator
- func (c *Aggregator) Checkpoint(ctx context.Context, desc *metric.Descriptor)
- func (c *Aggregator) Count() (int64, error)
- func (c *Aggregator) Max() (core.Number, error)
- func (c *Aggregator) Merge(oa export.Aggregator, desc *metric.Descriptor) error
- func (c *Aggregator) Min() (core.Number, error)
- func (c *Aggregator) Sum() (core.Number, error)
- func (c *Aggregator) Update(_ context.Context, number core.Number, desc *metric.Descriptor) error
Types ¶
type Aggregator ¶
type Aggregator struct {
// contains filtered or unexported fields
}
Aggregator aggregates measure events, keeping only the max, sum, and count.
func New ¶
func New(desc *metric.Descriptor) *Aggregator
New returns a new measure aggregator for computing min, max, sum, and count. It does not compute quantile information other than Max.
This aggregator uses the StateLocker pattern to guarantee the count, sum, min and max are consistent within a checkpoint
func (*Aggregator) Checkpoint ¶
func (c *Aggregator) Checkpoint(ctx context.Context, desc *metric.Descriptor)
Checkpoint saves the current state and resets the current state to the empty set.
func (*Aggregator) Count ¶
func (c *Aggregator) Count() (int64, error)
Count returns the number of values in the checkpoint.
func (*Aggregator) Max ¶
func (c *Aggregator) Max() (core.Number, error)
Max returns the maximum value in the checkpoint. The error value aggregator.ErrNoData will be returned if there were no measurements recorded during the checkpoint.
func (*Aggregator) Merge ¶
func (c *Aggregator) Merge(oa export.Aggregator, desc *metric.Descriptor) error
Merge combines two data sets into one.
func (*Aggregator) Min ¶
func (c *Aggregator) Min() (core.Number, error)
Min returns the minimum value in the checkpoint. The error value aggregator.ErrNoData will be returned if there were no measurements recorded during the checkpoint.
func (*Aggregator) Sum ¶
func (c *Aggregator) Sum() (core.Number, error)
Sum returns the sum of values in the checkpoint.
func (*Aggregator) Update ¶
func (c *Aggregator) Update(_ context.Context, number core.Number, desc *metric.Descriptor) error
Update adds the recorded measurement to the current data set.
Source Files ¶
mmsc.go
- Version
- v0.4.2
- Published
- Mar 31, 2020
- Platform
- linux/amd64
- Imports
- 6 packages
- Last checked
- 5 minutes ago –
Tools for package owners.