Sample time with "inverted" histogram?

Chris Vest mr.chrisvest at gmail.com
Fri Nov 27 16:08:11 UTC 2015


Hi,

I sometimes find myself wishing the sample time benchmark mode had an “inverse” histogram, because I find that this makes it easier to spot when response times are modal.

To demonstrate what I mean, the current histogram output looks like this: (numbers are fictive)
Samples, N = 3184
      mean =      2.531 ±(99.9%) 0.014 us/op
       min =      0.119 us/op
p( 0.0000) =      0.119 us/op
p(50.0000) =      2.420 us/op
p(90.0000) =      2.644 us/op
p(95.0000) =      2.816 us/op
p(99.0000) =      4.408 us/op
p(99.9000) =     13.152 us/op
p(99.9900) =     36.901 us/op
p(99.9990) =    254.240 us/op
p(99.9999) =    260.864 us/op
       max =    260.864 us/op

And I would like a configuration option that would make it look more like this: (numbers even more fictive)
Samples, N = 3184
      mean =      2.531 ±(99.9%) 0.014 us/op
       min =      0.119 us/op
     us/op = samples added in increment
         1 = 1081
         2 = 194
         4 = 959
         8 = 357
        16 = 3
        32 = 3
        64 = 118
       128 = 410
       256 = 58
       512 = 1
This way, I can more easily see that the numbers in my made-up example fall into 2 or 3 groups.
When I have needed something like this, I have thus far reached for HdrHistogram and its LogarithmicIterator, and the HistogramIterationValue.getCountAddedInThisIterationStep method.

Cheers,
Chris



More information about the jmh-dev mailing list