digests

package
v1.48.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 9, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DigestMap

type DigestMap struct {
	// contains filtered or unexported fields
}

DigestMap is a thread-safe map for storing t-digests keyed by string identifiers. It's designed for concurrent access patterns where multiple goroutines may read and write digest statistics simultaneously.

func NewDigestMap

func NewDigestMap() *DigestMap

NewDigestMap creates a new DigestMap instance.

func (*DigestMap) Add

func (dm *DigestMap) Add(key string, value float64)

Add adds a value to the digest for the given key. If the key doesn't exist, a new digest is created.

func (*DigestMap) CDF

func (dm *DigestMap) CDF(key string, value float64) (float64, bool)

CDF returns the cumulative distribution function value at the given value for the key. Returns the CDF value and true if the key exists, 0 and false otherwise.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL