Class ConsoleHistogramFormatter<T>
- java.lang.Object
-
- com.pervasivecode.utils.stats.histogram.ConsoleHistogramFormatter<T>
-
- Type Parameters:
T
- The type of value the histogram counted, which this formatter will format using the providedupperBoundValueFormatter
parameter.
public class ConsoleHistogramFormatter<T> extends Object
FormatHistogram
contents for a text display. The formatted output consists of a vertical list of labeled histogram buckets, with horizontal bar graphs showing the count in each bucket, followed by a percentage that represents the number of items counted in this bucket as a fraction of all items counted by this histogram.Example:
<= 1 ****** 4% <= 2 ********************* 15% <= 4 ************************************************************ 43% <= 8 ************************************************ 34% > 8 ***** 4%
- See Also:
BucketingSystem
-
-
Constructor Summary
Constructors Constructor Description ConsoleHistogramFormatter(Function<T,String> upperBoundValueFormatter, int maxBarGraphWidth)
Create a ConsoleHistogramFormatter that formats upper bound values usingupperBoundValueFormatter
.
-
-
-
Constructor Detail
-
ConsoleHistogramFormatter
public ConsoleHistogramFormatter(Function<T,String> upperBoundValueFormatter, int maxBarGraphWidth)
Create a ConsoleHistogramFormatter that formats upper bound values usingupperBoundValueFormatter
.- Parameters:
upperBoundValueFormatter
- A Function that converts an upper bound value into a String representation.maxBarGraphWidth
- The maximum width of the bar graph portion of the formatted representation.
-
-