the config values for this instance.
Vector of timestamps of each (powers of 2) ticks. This is the key to the exponential histogram representation. See ExpHist.Canonical for more info.
total ticks tracked. total == buckets.map(_.size).sum
current timestamp of this instance.
Increment ExpHist by delta at the supplied timestamp.
Efficiently add many buckets at once.
Efficiently add many buckets at once.
vector of buckets. All timestamps must be >= this.time.
ExpHist instance with all buckets added, stepped
forward to the max timestamp in unsorted
.
Returns an Approximate instance encoding the bounds and the closest long to the estimated sum tracked by this instance.
Vector of timestamps of each (powers of 2) ticks.
Vector of timestamps of each (powers of 2) ticks. This is the key to the exponential histogram representation. See ExpHist.Canonical for more info.
the config values for this instance.
Returns a Fold instance that uses add
to accumulate deltas
into this exponential histogram instance.
Estimate of the count seen across the last conf.windowSize timestamps.
Estimate of the count seen across the last conf.windowSize timestamps. Guaranteed to be within conf.epsilon of the true count.
Increment ExpHist by 1 at the supplied timestamp.
Smallest possible count seen in the last conf.windowSize timestamps.
relative error of guess, guaranteed to be <= conf.epsilon.
Steps this instance forward to the new supplied time.
Steps this instance forward to the new supplied time. Any buckets with a timestamp <= (newTime - conf.windowSize) will be evicted.
the new current time.
ExpHist instance stepped forward to newTime.
current timestamp of this instance.
total ticks tracked.
total ticks tracked. total == buckets.map(_.size).sum
Largest possible count seen in the last conf.windowSize timestamps.
Exponential Histogram algorithm from http://www-cs-students.stanford.edu/~datar/papers/sicomp_streams.pdf
An Exponential Histogram is a sliding window counter that can guarantee a bounded relative error. You configure the data structure with
- epsilon, the relative error you're willing to tolerate - windowSize, the number of time ticks that you want to track
You interact with the data structure by adding (number, timestamp) pairs into the exponential histogram. querying it for an approximate counts with
guess
.The approximate count is guaranteed to be within conf.epsilon relative error of the true count seen across the supplied
windowSize
.Next steps:
- efficient serialization - Query EH with a shorter window than the configured window - Discussion of epsilon vs memory tradeoffs
the config values for this instance.
Vector of timestamps of each (powers of 2) ticks. This is the key to the exponential histogram representation. See ExpHist.Canonical for more info.
total ticks tracked.
total == buckets.map(_.size).sum
current timestamp of this instance.