public abstract class AbstractReporter extends Object implements Reporter
Reporter
is held.
The class is also well tested.Constructor and Description |
---|
AbstractReporter() |
Modifier and Type | Method and Description |
---|---|
Set<Destination> |
getDestinations()
Gets an unmodifiable set of all registered destinations.
|
Set<BoundPeriod<Destination>> |
getReportingPeriods()
Gets an unmodifiable set of registered reporting periods.
|
Measurement |
newMeasurement()
Gets a new measurement pre-filled with values from current run info.
|
void |
registerDestination(Destination destination,
Period period)
Registers a destination to receive resulting
Measurements in
a given period. |
void |
registerDestination(Destination destination,
Set<Period> periods)
Registers a destination to receive resulting
Measurements in
given periods. |
void |
report(MeasurementUnit measurementUnit)
Reports a single
MeasurementUnit to this reporter. |
void |
reset()
Resets the reporter statistics to the initial state.
|
void |
setReportManager(ReportManager reportManager)
Sets
Report Manager for the report to be able to control and
monitor the current status of reporting. |
void |
setRunInfo(RunInfo runInfo)
Sets
Run Info for the current measurement run. |
void |
start()
Starts the reporter.
|
void |
stop()
Stops the reporter.
|
void |
unregisterDestination(Destination destination)
Removes a previously registered Destination.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
publishResult
public final void report(MeasurementUnit measurementUnit) throws ReportingException
MeasurementUnit
to this reporter. This calls doReport(MeasurementUnit)
overridden by a child, accumulates results and reports iteration change and percentage change (if any).report
in interface Reporter
measurementUnit
- Measurement Unit from a run iterationReportingException
- When it was not possible to report the MeasurementUnit
.public Measurement newMeasurement()
public void setReportManager(ReportManager reportManager)
Reporter
Report Manager
for the report to be able to control and
monitor the current status of reporting.setReportManager
in interface Reporter
reportManager
- ReportManager that owns this Reporter.public final void registerDestination(Destination destination, Period period)
Reporter
Measurements
in
a given period.registerDestination
in interface Reporter
destination
- The Destination to which the results should be publishedperiod
- The period interval in which the destination should publish resultspublic final void registerDestination(Destination destination, Set<Period> periods)
Reporter
Measurements
in
given periods. It is the goal of Reporter to make sure the
results are published to the registered destinations. For an easier development it is advised
to extend AbstractReporter
which already takes care of this.
A destination cannot be registered with the same period type multiple times (i.e. one cannot register
a destination with a period of iteration type that reports every 10 iterations, and with a period of
iteration type that reports every 100 iterations at the same time).registerDestination
in interface Reporter
destination
- The Destination to which the results should be published.periods
- The set of period intervals in which the destination should publish results.public final void unregisterDestination(Destination destination)
Reporter
unregisterDestination
in interface Reporter
destination
- The Destination to be unregistered (and stopped)public final void reset()
Reporter
public final Set<Destination> getDestinations()
Reporter
getDestinations
in interface Reporter
public void start()
Reporter
public void stop()
Reporter
public final void setRunInfo(RunInfo runInfo)
Reporter
Run Info
for the current measurement run. This must be set
prior to starting the reporter. Failed to do so can lead to an assertion error.setRunInfo
in interface Reporter
runInfo
- RunInfo for the current measurement run.public final Set<BoundPeriod<Destination>> getReportingPeriods()
Reporter
getReportingPeriods
in interface Reporter
Copyright © 2010–2017 PerfCake Community. All rights reserved.