Documentation ¶
Index ¶
- type Aggregator
- func (c *Aggregator) Aggregation() aggregation.Aggregation
- func (c *Aggregator) Count() (uint64, error)
- func (c *Aggregator) Histogram() (aggregation.Buckets, error)
- func (c *Aggregator) Kind() aggregation.Kind
- func (c *Aggregator) Merge(oa aggregator.Aggregator, desc *sdkapi.Descriptor) error
- func (c *Aggregator) Sum() (number.Number, error)
- func (c *Aggregator) SynchronizedMove(oa aggregator.Aggregator, desc *sdkapi.Descriptor) error
- func (c *Aggregator) Update(_ context.Context, number number.Number, desc *sdkapi.Descriptor) error
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Aggregator ¶
type Aggregator struct {
// contains filtered or unexported fields
}
Aggregator observe events and counts them in pre-determined buckets. It also calculates the sum and count of all events.
func New ¶
func New(cnt int, desc *sdkapi.Descriptor, opts ...Option) []Aggregator
New returns a new aggregator for computing Histograms.
A Histogram observe events and counts them in pre-defined buckets. And also provides the total sum and count of all observations.
Note that this aggregator maintains each value using independent atomic operations, which introduces the possibility that checkpoints are inconsistent.
func (*Aggregator) Aggregation ¶
func (c *Aggregator) Aggregation() aggregation.Aggregation
Aggregation returns an interface for reading the state of this aggregator.
func (*Aggregator) Count ¶
func (c *Aggregator) Count() (uint64, error)
Count returns the number of values in the checkpoint.
func (*Aggregator) Histogram ¶
func (c *Aggregator) Histogram() (aggregation.Buckets, error)
Histogram returns the count of events in pre-determined buckets.
func (*Aggregator) Kind ¶
func (c *Aggregator) Kind() aggregation.Kind
Kind returns aggregation.HistogramKind.
func (*Aggregator) Merge ¶
func (c *Aggregator) Merge(oa aggregator.Aggregator, desc *sdkapi.Descriptor) error
Merge combines two histograms that have the same buckets into a single one.
func (*Aggregator) Sum ¶
func (c *Aggregator) Sum() (number.Number, error)
Sum returns the sum of all values in the checkpoint.
func (*Aggregator) SynchronizedMove ¶
func (c *Aggregator) SynchronizedMove(oa aggregator.Aggregator, desc *sdkapi.Descriptor) error
SynchronizedMove saves the current state into oa and resets the current state to the empty set. Since no locks are taken, there is a chance that the independent Sum, Count and Bucket Count are not consistent with each other.
func (*Aggregator) Update ¶
func (c *Aggregator) Update(_ context.Context, number number.Number, desc *sdkapi.Descriptor) error
Update adds the recorded measurement to the current data set.
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option configures a histogram config.
func WithExplicitBoundaries ¶
WithExplicitBoundaries sets the ExplicitBoundaries configuration option of a config.