Skip to content

ScalableStats is a library to allow collection and processing of metrics with O(1) constant time and space guarantees

License

Notifications You must be signed in to change notification settings

dblueman/scalablestats

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ScalableStats

ScalableStats is a library to allow collection and processing of metrics with O(1) constant time and space guarantees; this makes it suitable for frequently-sampled metrics such as temperature.

Guarantees are provided by forming a histogram based on apriori knowledge of the data, for example sampled temperatures will lie in the range of 10 to 80'C, quantized to 2'C, ie 35 bins.

Arbitrary percentiles can be extracted from the resultant histogram.

Example

h := NewLinearHistogram(10, 80, 35)

for i := 0; i < 100000; i++ {
    h.Store(rand.Float32() * 80)
}

fmt.Printf("P95=%v\n", h.Percentile(95))
h.Fprint(os.Stdout)
h.CLear()

About

ScalableStats is a library to allow collection and processing of metrics with O(1) constant time and space guarantees

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages