Documentation
¶
Overview ¶
Package cm implements the Cormode-Muthukrishnan algorithm for computing biased quantiles over data streams from "Effective Computation of Biased Quantiles over Data Streams" and is largely based on statsite's implementation in C: https://github.com/statsite/statsite/blob/master/src/cm_quantile.c
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Options ¶
type Options interface {
// SetEps sets the desired epsilon for errors.
SetEps(value float64) Options
// Eps returns the desired epsilon for errors.
Eps() float64
// SetCapacity sets the initial heap capacity.
SetCapacity(value int) Options
// Capacity returns the initial heap capacity.
Capacity() int
// SetInsertAndCompressEvery sets how frequently the timer values are
// inserted into the stream and compressed to reduce write latency for
// high frequency timers.
SetInsertAndCompressEvery(value int) Options
// InsertAndCompressEvery returns how frequently the timer values are
// inserted into the stream and compressed to reduce write latency for
// high frequency timers.
InsertAndCompressEvery() int
// SetStreamPool sets the stream pool.
SetStreamPool(value StreamPool) Options
// StreamPool returns the stream pool.
StreamPool() StreamPool
// Validate validates the options.
Validate() error
}
Options represent various options for computing quantiles.
type Sample ¶
type Sample struct {
// contains filtered or unexported fields
}
Sample represents a sampled value.
type Stream ¶
type Stream struct {
// contains filtered or unexported fields
}
Stream represents a data stream.
func (*Stream) ResetSetData ¶
ResetSetData resets the stream and sets data.
type StreamPool ¶
type StreamPool struct {
// contains filtered or unexported fields
}
StreamPool is a pool of streams, wrapping sync.Pool.
func NewStreamPool ¶
func NewStreamPool(opts Options) StreamPool
NewStreamPool creates a new StreamPool.
Click to show internal directories.
Click to hide internal directories.