ParsePercentiles extracts the percentiles from string (flag).
Round rounds to 4 digits after the decimal point.
RoundToDigits rounds the input to digits number of digits after decimal point. Note this incorrectly rounds the last digit of negative numbers.
Bucket is the data for 1 bucket: an Interval and the occurrence Count for that interval.
Counter is a type whose instances record values and calculate stats (count,average,min,max,stddev).
Avg returns the average.
Log outputs the stats to the logger.
Print prints stats.
Record records a data point.
RecordN efficiently records the same value N times
Reset clears the counter to reset it to original 'no data' state.
StdDev returns the standard deviation.
Transfer merges the data from src into this Counter and clears src.
Histogram extends Counter and adds an histogram. Must be created using NewHistogram or anotherHistogram.Clone() and not directly.
Merge two different histogram with different scale parameters Lowest offset and highest divider value will be selected on new Histogram as scale parameters
NewHistogram creates a new histogram (sets up the buckets). Divider value can not be zero, otherwise returns zero
Clone returns a copy of the histogram.
CopyFrom sets the content of this object to a copy of the src.
Export translate the internal representation of the histogram data in an externally usable one. Calculates the request Percentiles.
Log Logs the histogram to the counter.
Print dumps the histogram (and counter) to the provided writer. Also calculates the percentiles. Use Export() once and Print if you are going to need the Export results too.
Record records a data point.
RecordN efficiently records a data point N times.
Reset clears the data. Reset it to NewHistogram state.
Transfer merges the data from src into this Histogram and clears src.
HistogramData is the exported Histogram data, a sorted list of intervals covering [Min, Max]. Pure data, so Counter for instance is flattened
CalcPercentile returns the value for an input percentile e.g. for 90. as input returns an estimate of the original value threshold where 90.0% of the data is below said threshold. with 3 data points 10, 20, 30; p0-p33.33 == 10, p 66.666 = 20, p100 = 30 p33.333 - p66.666 = linear between 10 and 20; so p50 = 15 TODO: consider spreading the count of the bucket evenly from start to end so the % grows by at least to 1/N on start of range, and for last range when start == end we should get to that % faster
CalcPercentiles calculates the requested percentile and add them to the HistogramData. Potential TODO: sort or assume sorting and calculate all the percentiles in 1 pass (greater and greater values).
Print dumps the histogram (and counter) to the provided writer. Also calculates the percentile.
Interval is a range from start to end. Interval are left closed, open right expect the last one which includes Max. ie [Start, End[ with the next one being [PrevEnd, NextEnd[.
Percentile value for the percentile