简体   繁体   中英

HdrHistogram: how to control the number of buckets in outputPercentileDistribution()?

I've been using HdrPercentile library in Java to monitor distribution of certain number in my system.

I decided to take a shortcut and use outputPercentileDistribution to let HdrHistogram show me what it thinks of my data.

The output has been useful, but I have hard time understanding how HdrHistogram controls the number of buckets it prints.

The number is controlled by the function argument

Produce textual representation of the value distribution of histogram data by percentile. The distribution is output with exponentially increasing resolution, with each exponentially decreasing half-distance containing dumpTicksPerHalf percentile reporting tick points.

percentileTicksPerHalfDistance The number of reporting points per exponentially decreasing half-distance

I do not understand exactly how it's translated into buckets. I did notice that the larger the number that I pass, the more buckets I get.

Can someone explain exactly how the buckets are set up?

After looking at the source code, I think I see what's going on there.

The function argument is slightly misnamed. It really should be percentileBucketsPerHalfDistance .

The system takes half the distance to 100% (initially 50%) and splits it into the given number of buckets. So, for percentileBucketsPerHalfDistance = 2 we get buckets at 0 and 25%.

Then the system takes a half of what' left to 100% again, let's say 50 to 75%, and splits it into the required number of buckets, let's say 50% and 62.5%.

Then we deal with 75% to 87.5%, split into 2 again, so we get 75% and 81.25%

Eventually we get so close to 100% that we overshoot and get 99.9997138977 and 100.0

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM