public abstract class StatsReporter extends AbstractReporter
Reports the minimal, maximal and average value from the beginning
of the measuring to the moment when the results are published including. The actual value about what
the statistics are gathered is computed as a result of the computeResult(MeasurementUnit)
method.
The default value of the reporter is a current value at the moment of publishing.
Modifier and Type | Class and Description |
---|---|
static class |
StatsReporter.WindowType
The type of the window, either the number of iterations or a time duration.
|
Modifier and Type | Field and Description |
---|---|
static String |
AVERAGE
A String representation of a metric of an average value.
|
static String |
MAXIMUM
A String representation of a metric of a maximal value.
|
static String |
MINIMUM
A String representation of a metric of a minimal value.
|
Constructor and Description |
---|
StatsReporter() |
Modifier and Type | Method and Description |
---|---|
String |
getHistogram()
Gets the string specifying where the histogram should be split.
|
String |
getHistogramPrefix()
Gets the string prefix used in the result map for histogram entries.
|
int |
getWindowSize()
Gets the sliding window size if set.
|
StatsReporter.WindowType |
getWindowType()
Returns the type of the window.
|
boolean |
isAverageEnabled()
Gets the status of the metric of an average value.
|
boolean |
isMaximumEnabled()
Gets the status of the metric of a maximal value
|
boolean |
isMinimumEnabled()
Gets the status of the metric of a minimal value.
|
boolean |
isRequestSizeEnabled()
Is the metric of the request size enabled?
|
boolean |
isResponseSizeEnabled()
Is the metric of the response size enabled?
|
void |
publishResult(PeriodType periodType,
Destination destination)
Publishes results to the destination.
|
StatsReporter |
setAverageEnabled(boolean averageEnabled)
Enables or disables the metric of an average value.
|
StatsReporter |
setHistogram(String histogram)
Sets the string specifying where the histogram should be split.
|
StatsReporter |
setHistogramPrefix(String histogramPrefix)
Sets the string prefix used in the result map for histogram entries.
|
StatsReporter |
setMaximumEnabled(boolean maximumEnabled)
Enables or disables the metric of a maximal value.
|
StatsReporter |
setMinimumEnabled(boolean minimumEnabled)
Enables or disables the metric of a minimal value.
|
StatsReporter |
setRequestSizeEnabled(boolean requestSizeEnabled)
Enables and disables the metric of the request size.
|
StatsReporter |
setResponseSizeEnabled(boolean responseSizeEnabled)
Enables and disables the metric of the response size.
|
StatsReporter |
setWindowSize(int windowSize)
Sets the size of the sliding window.
|
StatsReporter |
setWindowType(StatsReporter.WindowType windowType)
Sets the type of the window.
|
getDestinations, getReportingPeriods, newMeasurement, registerDestination, registerDestination, report, reset, setReportManager, setRunInfo, start, stop, unregisterDestination
public static final String MAXIMUM
public static final String MINIMUM
public static final String AVERAGE
public void publishResult(PeriodType periodType, Destination destination) throws ReportingException
Reporter
periodType
- A period type that caused the invocation of this method.destination
- A destination to which the result should be reported.ReportingException
- When it was not possible to publish results to the given destination.public boolean isMaximumEnabled()
true
if the metric of a maximal is enabled or false
otherwise.public StatsReporter setMaximumEnabled(boolean maximumEnabled)
maximumEnabled
- Set true
to enable the metric of a maximal value or false
to disable it.public boolean isMinimumEnabled()
true
if the metric of a minimal value is enabled or false
otherwise.public StatsReporter setMinimumEnabled(boolean minimumEnabled)
minimumEnabled
- true
to enable the metric of a minimal value or false
to disable it.public boolean isAverageEnabled()
true
if the metric of an average value is enabled or false
otherwise.public StatsReporter setAverageEnabled(boolean averageEnabled)
averageEnabled
- true
to enable the metric of an average value or false
to disable it.public int getWindowSize()
Integer.MAX_VALUE
, then it means the
sliding window is not used at all and the statistics are taken from the whole run.public StatsReporter setWindowSize(int windowSize)
Sets the size of the sliding window.
If the size is equal to Integer.MAX_VALUE
(which is the default value), then it means the
sliding window is not used at all and the statistics are taken from the whole run.
windowSize
- The sliding window size.public String getHistogram()
public StatsReporter setHistogram(String histogram)
histogram
- The string specifying where the histogram should be split.public String getHistogramPrefix()
public StatsReporter setHistogramPrefix(String histogramPrefix)
histogramPrefix
- The string prefix used in the result map for histogram entries.public boolean isRequestSizeEnabled()
public StatsReporter setRequestSizeEnabled(boolean requestSizeEnabled)
requestSizeEnabled
- True to enable the metric.public boolean isResponseSizeEnabled()
public StatsReporter setResponseSizeEnabled(boolean responseSizeEnabled)
responseSizeEnabled
- True to enable the metric.public StatsReporter.WindowType getWindowType()
public StatsReporter setWindowType(StatsReporter.WindowType windowType)
windowType
- Either ITERATION or TIME is supported.Copyright © 2010–2017 PerfCake Community. All rights reserved.