package ddsketch
import "github.com/DataDog/sketches-go/ddsketch"
Index ¶
- type DDSketch
- func LogCollapsingHighestDenseDDSketch(relativeAccuracy float64, maxNumBins int) (*DDSketch, error)
- func LogCollapsingLowestDenseDDSketch(relativeAccuracy float64, maxNumBins int) (*DDSketch, error)
- func LogUnboundedDenseDDSketch(relativeAccuracy float64) (*DDSketch, error)
- func NewDDSketch(indexMapping mapping.IndexMapping, positiveValueStore store.Store, negativeValueStore store.Store) *DDSketch
- func NewDefaultDDSketch(relativeAccuracy float64) (*DDSketch, error)
- func (s *DDSketch) Add(value float64) error
- func (s *DDSketch) AddWithCount(value, count float64) error
- func (s *DDSketch) Copy() *DDSketch
- func (s *DDSketch) FromProto(pb *sketchpb.DDSketch) (*DDSketch, error)
- func (s *DDSketch) GetCount() float64
- func (s *DDSketch) GetMaxValue() (float64, error)
- func (s *DDSketch) GetMinValue() (float64, error)
- func (s *DDSketch) GetValueAtQuantile(quantile float64) (float64, error)
- func (s *DDSketch) GetValuesAtQuantiles(quantiles []float64) ([]float64, error)
- func (s *DDSketch) IsEmpty() bool
- func (s *DDSketch) MergeWith(other *DDSketch) error
- func (s *DDSketch) ToProto() *sketchpb.DDSketch
Types ¶
type DDSketch ¶
type DDSketch struct { mapping.IndexMapping // contains filtered or unexported fields }
func LogCollapsingHighestDenseDDSketch ¶
Constructs an instance of DDSketch that offers constant-time insertion and whose size grows until the maximum number of bins is reached, at which point bins with highest indices are collapsed, which causes the relative accuracy guarantee to be lost on highest quantiles if values are all positive, or the lowest and highest quantiles if values include negative numbers.
func LogCollapsingLowestDenseDDSketch ¶
Constructs an instance of DDSketch that offers constant-time insertion and whose size grows until the maximum number of bins is reached, at which point bins with lowest indices are collapsed, which causes the relative accuracy guarantee to be lost on lowest quantiles if values are all positive, or the mid-range quantiles for values closest to zero if values include negative numbers.
func LogUnboundedDenseDDSketch ¶
Constructs an instance of DDSketch that offers constant-time insertion and whose size grows indefinitely to accommodate for the range of input values.
func NewDDSketch ¶
func NewDDSketch(indexMapping mapping.IndexMapping, positiveValueStore store.Store, negativeValueStore store.Store) *DDSketch
func NewDefaultDDSketch ¶
func (*DDSketch) Add ¶
Adds a value to the sketch.
func (*DDSketch) AddWithCount ¶
Adds a value to the sketch with a float64 count.
func (*DDSketch) Copy ¶
Return a (deep) copy of this sketch.
func (*DDSketch) FromProto ¶
Builds a new instance of DDSketch based on the provided protobuf representation.
func (*DDSketch) GetCount ¶
Return the total number of values that have been added to this sketch.
func (*DDSketch) GetMaxValue ¶
Return the maximum value that has been added to this sketch. Return a non-nil error if the sketch is empty.
func (*DDSketch) GetMinValue ¶
Return the minimum value that has been added to this sketch. Returns a non-nil error if the sketch is empty.
func (*DDSketch) GetValueAtQuantile ¶
Return the value at the specified quantile. Return a non-nil error if the quantile is invalid or if the sketch is empty.
func (*DDSketch) GetValuesAtQuantiles ¶
Return the values at the respective specified quantiles. Return a non-nil error if any of the quantiles is invalid or if the sketch is empty.
func (*DDSketch) IsEmpty ¶
Return true iff no value has been added to this sketch.
func (*DDSketch) MergeWith ¶
Merges the other sketch into this one. After this operation, this sketch encodes the values that were added to both this and the other sketches.
func (*DDSketch) ToProto ¶
Generates a protobuf representation of this DDSketch.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
ddsketch/mapping | |
ddsketch/pb | |
ddsketch/pb/sketchpb | |
ddsketch/store |
- Version
- v1.0.0
- Published
- Dec 14, 2020
- Platform
- windows/amd64
- Imports
- 5 packages
- Last checked
- 15 hours ago –
Tools for package owners.