Convenience class that makes it easier to log values in a histogram-like fashion.
Values are automatically grouped into ranges/"bins" of similar values; the width of the
"bins" into which values are grouped can be specified by the constructor parameter "factor".
New values are divided by the given factor in order to determine the bin in which the
value should be counted, e.g. if you construct a HistogramLikeValue with a factor of "1000"
and add the following values
50
80
100
150
1050
1100
then these values are grouped into two different bins, one between 0-999 and one between 1000-1999.
In this example, you would have 4 values in the bin named "biggerThan0" and 2 values in
the bin named "biggerThan1000".
See unit test for details.
Furthermore, if you specify a "maxLimit" as optional constructor argument, all values bigger
than this maximum threshold will be grouped in one single bin (biggerThan
) rather
than grouped into separate bins as specified by "factor".
The "bins" are not sized automatically because this would require storing all added
values so that the bin values could be re-calculated.
The HistogramLikeValue automatically creates counter and timer values in the background;
the names of these Reportables are constructed using the "baseName" specified as
constructor argument. In the end, the following InApplicationMonitor reportables are created
by this class:
<basename>.total Timer recording all values
<basename>.biggerThan<value> Counter for each bin that is created
<basename>.currentMax StateValue holding the current maximum value