Documentation
¶
Overview ¶
Package quantile provides a quantile sketch.
Index ¶
- Variables
- type Agent
- type Bound
- type Config
- type DDSketchBinGenerator
- type Key
- type KeyCount
- type Sketch
- func (s *Sketch) ApproxEquals(o *Sketch, e float64) bool
- func (s *Sketch) Cols() (k []int32, n []uint32)
- func (s *Sketch) Copy() *Sketch
- func (s *Sketch) CopyTo(dst *Sketch)
- func (s *Sketch) Equals(o *Sketch) bool
- func (s *Sketch) GetRawBins() (int, string)
- func (s *Sketch) Insert(c *Config, vals ...float64)
- func (s *Sketch) InsertMany(c *Config, values []float64)
- func (s *Sketch) MemSize() (used, allocated int)
- func (s *Sketch) Merge(c *Config, o *Sketch)
- func (s *Sketch) Quantile(c *Config, q float64) float64
- func (s *Sketch) Reset()
- func (s *Sketch) String() string
Constants ¶
This section is empty.
Variables ¶
var (
// ErrNonMonotonicBoundaries is returned when the boundaries of an explicit bucket histogram are not monotonic.
ErrNonMonotonicBoundaries = "explicit bucket histogram: non-monotonic boundaries"
)
Functions ¶
This section is empty.
Types ¶
type Agent ¶
An Agent sketch is an insert optimized version of the sketch for use in the datadog-agent.
func (*Agent) InsertInterpolate ¶
InsertInterpolate linearly interpolates a count from the given lower to upper bounds
type Bound ¶ added in v0.71.0
type Bound struct {
// Key is the quantized value of the bound.
Key Key
Low float64 // Low is the lower bound of the range.
}
Bound is a quantized value and its corresponding lower bound.
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
A Config struct is passed around to many sketches (read-only).
type DDSketchBinGenerator ¶ added in v0.71.0
type DDSketchBinGenerator struct {
// Config is the configuration for the sketch.
Config *Config
Bounds []Bound
BoundMap map[Key]*Bound
}
DDSketchBinGenerator is a generator for DDSketch bounds.
func NewDDSketchBinGenerator ¶ added in v0.71.0
func NewDDSketchBinGenerator(config *Config) *DDSketchBinGenerator
NewDDSketchBinGenerator creates a new DDSketchBinGenerator for the given config.
func NewDDSketchBinGeneratorForAgent ¶ added in v0.71.0
func NewDDSketchBinGeneratorForAgent() *DDSketchBinGenerator
NewDDSketchBinGeneratorForAgent creates a new DDSketchBinGenerator for the agent.
func (*DDSketchBinGenerator) GetBound ¶ added in v0.71.0
func (g *DDSketchBinGenerator) GetBound(key Key) (*Bound, bool)
GetBound returns the bound for the given key.
func (*DDSketchBinGenerator) GetBounds ¶ added in v0.71.0
func (g *DDSketchBinGenerator) GetBounds() []Bound
GetBounds returns the bounds for the DDSketchBinGenerator.
func (*DDSketchBinGenerator) GetKeyForValue ¶ added in v0.71.0
func (g *DDSketchBinGenerator) GetKeyForValue(value float64) Key
GetKeyForValue returns the key for the given value.
type Key ¶
type Key int16
A Key represents a quantized version of a float64. See Config for more details
type KeyCount ¶
type KeyCount struct {
// contains filtered or unexported fields
}
A KeyCount represents a Key and an associated count
type Sketch ¶
type Sketch struct {
Basic summary.Summary `json:"summary"`
// contains filtered or unexported fields
}
A Sketch for tracking quantiles The serialized JSON of Sketch contains the summary only Bins are not included.
func ConvertDDSketchIntoSketch ¶
ConvertDDSketchIntoSketch converts a DDSketch into a Sketch, by first converting the DDSketch into a new DDSketch with a mapping that's compatible with Sketch parameters, then creating the Sketch by copying the DDSketch bins to the Sketch store.
func (*Sketch) ApproxEquals ¶
ApproxEquals checks if s and o are equivalent, with e error allowed for Sum and Average
func (*Sketch) GetRawBins ¶
GetRawBins return raw bins information as string
func (*Sketch) Insert ¶
Insert a single value into the sketch. NOTE: InsertMany is much more efficient.
func (*Sketch) InsertMany ¶
InsertMany values into the sketch.
func (*Sketch) MemSize ¶
MemSize returns memory use in bytes:
used: uses len(bins) allocated: uses cap(bins)
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
sketchtest
module
|
|
|
Package summary provides a summary of a quantile sketch.
|
Package summary provides a summary of a quantile sketch. |