Documentation ¶
Overview ¶
Copyright 2019, OpenTelemetry Authors
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- type Aggregator
- func (c *Aggregator) Checkpoint(ctx context.Context, _ *export.Descriptor)
- func (c *Aggregator) Count() (int64, error)
- func (c *Aggregator) Max() (core.Number, error)
- func (c *Aggregator) Merge(oa export.Aggregator, d *export.Descriptor) error
- func (c *Aggregator) Min() (core.Number, error)
- func (c *Aggregator) Quantile(q float64) (core.Number, error)
- func (c *Aggregator) Sum() (core.Number, error)
- func (c *Aggregator) Update(_ context.Context, number core.Number, desc *export.Descriptor) error
- type Config
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 aggregates measure events.
func New ¶
func New(cfg *Config, desc *export.Descriptor) *Aggregator
New returns a new DDSketch aggregator.
func (*Aggregator) Checkpoint ¶ added in v0.1.1
func (c *Aggregator) Checkpoint(ctx context.Context, _ *export.Descriptor)
Checkpoint saves the current state and resets the current state to the empty set, taking a lock to prevent concurrent Update() calls.
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.
func (*Aggregator) Merge ¶
func (c *Aggregator) Merge(oa export.Aggregator, d *export.Descriptor) error
Merge combines two sketches into one.
func (*Aggregator) Min ¶
func (c *Aggregator) Min() (core.Number, error)
Min returns the mininum value in the checkpoint.
func (*Aggregator) Quantile ¶
func (c *Aggregator) Quantile(q float64) (core.Number, error)
Quantile returns the estimated quantile of data in the checkpoint. It is an error if `q` is less than 0 or greated than 1.
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 *export.Descriptor) error
Update adds the recorded measurement to the current data set. Update takes a lock to prevent concurrent Update() and Checkpoint() calls.
type Config ¶ added in v0.1.1
Config is an alias for the underlying DDSketch config object.
func NewDefaultConfig ¶
func NewDefaultConfig() *Config
NewDefaultConfig returns a new, default DDSketch config.
TODO: Should the Config constructor set minValue to -Inf to when the descriptor has absolute=false? This requires providing values for alpha and maxNumBins, apparently.