Documentation
¶
Index ¶
- Constants
- type BucketEntry
- type CompressedBuckets
- type PgUddSketch
- type ReadableUddSketch
- type SketchHashEntry
- type SketchHashKey
- type SketchHashMap
- type UDDSketch
- func (s *UDDSketch) AddValue(value float64)
- func (s *UDDSketch) Count() uint64
- func (s *UDDSketch) EstimateQuantile(quantile float64) float64
- func (s *UDDSketch) EstimateQuantileAtValue(value float64) float64
- func (s *UDDSketch) Max() float64
- func (s *UDDSketch) MaxError() float64
- func (s *UDDSketch) Mean() float64
- func (s *UDDSketch) MergeSketch(other *UDDSketch)
- func (s *UDDSketch) Min() float64
- func (s *UDDSketch) Sum() float64
- func (s *UDDSketch) ToRON() string
- func (s *UDDSketch) ToReadable() *ReadableUddSketch
- func (s *UDDSketch) ZeroCount() uint64
Constants ¶
const ( Invalid byte = iota Negative Zero Positive )
Constants for SketchHashKey types
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BucketEntry ¶
type BucketEntry struct { Key SketchHashKey `json:"key"` Count uint64 `json:"count"` }
BucketEntry represents a bucket in the sketch
type CompressedBuckets ¶
type CompressedBuckets struct {
// contains filtered or unexported fields
}
CompressedBuckets holds the compressed representation of sketch buckets
type PgUddSketch ¶
type PgUddSketch struct {
// contains filtered or unexported fields
}
PgUddSketch represents the PostgreSQL-compatible UDDSketch structure
type ReadableUddSketch ¶
type ReadableUddSketch struct { Version uint8 `json:"version"` Alpha float64 `json:"alpha"` MaxBuckets uint32 `json:"max_buckets"` NumBuckets uint32 `json:"num_buckets"` Compactions uint64 `json:"compactions"` Count uint64 `json:"count"` Sum float64 `json:"sum"` Buckets []BucketEntry `json:"buckets"` }
ReadableUddSketch represents a human-readable format of the UDDSketch
type SketchHashEntry ¶
type SketchHashEntry struct {
// contains filtered or unexported fields
}
SketchHashEntry represents an entry in the SketchHashMap
type SketchHashKey ¶
type SketchHashKey struct {
// contains filtered or unexported fields
}
SketchHashKey represents the bucket index in the UDDSketch
type SketchHashMap ¶
type SketchHashMap struct {
// contains filtered or unexported fields
}
SketchHashMap is a specialized hash map that maintains ordered buckets
type UDDSketch ¶
type UDDSketch struct {
// contains filtered or unexported fields
}
UDDSketch implements the UDDSketch algorithm
func NewUDDSketch ¶
NewUDDSketch creates a new UDDSketch with specified parameters
func (*UDDSketch) EstimateQuantile ¶
EstimateQuantile returns the estimated value at the given quantile
func (*UDDSketch) EstimateQuantileAtValue ¶
EstimateQuantileAtValue estimates what quantile a value would be in the current sketch
func (*UDDSketch) MergeSketch ¶
MergeSketch merges another sketch into this one
func (*UDDSketch) ToReadable ¶
func (s *UDDSketch) ToReadable() *ReadableUddSketch