public final class SampleModelImplementation extends Object implements SampleModel
When notifying listeners of changes to the number of tests we send copies of the new index arrays. This helps because most listeners are Swing dispatched and so can't guarantee the model is in a reasonable state when they call back.
SampleModel.AbstractListener, SampleModel.Listener, SampleModel.State| Constructor and Description |
|---|
SampleModelImplementation(ConsoleProperties properties,
StatisticsServices statisticsServices,
Timer timer,
Resources resources,
ErrorHandler errorHandler)
Creates a new
SampleModelImplementation instance. |
| Modifier and Type | Method and Description |
|---|---|
void |
addModelListener(SampleModel.Listener listener)
Add a new model listener.
|
void |
addSampleListener(Test test,
SampleListener listener)
Add a new sample listener for the specific test.
|
void |
addTestReport(TestStatisticsMap testStatisticsMap)
Add a new test report.
|
void |
addTotalSampleListener(SampleListener listener)
Add a new total sample listener.
|
StatisticExpression |
getPeakTPSExpression()
Get the expression for peak TPS.
|
SampleModel.State |
getState()
Get the current model state.
|
StatisticsSet |
getTotalCumulativeStatistics()
Get the cumulative statistics for this model.
|
StatisticsSet |
getTotalLatestStatistics()
Get the total statistics for the latest sample.
|
StatisticExpression |
getTPSExpression()
Get the statistics expression for TPS.
|
void |
registerTests(Collection<Test> tests)
Register new tests.
|
void |
reset()
Discard all of the information held by the model.
|
void |
start()
Start the model.
|
void |
stop()
Stop the model.
|
void |
zeroStatistics()
Zero the statistics.
|
public SampleModelImplementation(ConsoleProperties properties, StatisticsServices statisticsServices, Timer timer, Resources resources, ErrorHandler errorHandler) throws GrinderException
SampleModelImplementation instance.properties - The console properties.statisticsServices - Statistics services.timer - A timer.resources - Console resources.errorHandler - Error handlerGrinderException - if an error occurspublic StatisticExpression getTPSExpression()
getTPSExpression in interface SampleModelpublic StatisticExpression getPeakTPSExpression()
getPeakTPSExpression in interface SampleModelpublic void registerTests(Collection<Test> tests)
registerTests in interface SampleModeltests - The new tests.public StatisticsSet getTotalCumulativeStatistics()
getTotalCumulativeStatistics in interface SampleModelpublic StatisticsSet getTotalLatestStatistics()
getTotalLatestStatistics in interface SampleModelpublic void addModelListener(SampleModel.Listener listener)
addModelListener in interface SampleModellistener - The listener.public void addSampleListener(Test test, SampleListener listener)
addSampleListener in interface SampleModeltest - The test to add the sample listener for.listener - The sample listener.public void addTotalSampleListener(SampleListener listener)
addTotalSampleListener in interface SampleModellistener - The sample listener.public void reset()
This doesn't change the model state.
reset in interface SampleModelpublic void zeroStatistics()
zeroStatistics in interface SampleModelpublic void start()
start in interface SampleModelpublic void stop()
stop in interface SampleModelpublic void addTestReport(TestStatisticsMap testStatisticsMap)
addTestReport in interface SampleModeltestStatisticsMap - The new test statistics.public SampleModel.State getState()
getState in interface SampleModelCopyright © 2000-2014. All Rights Reserved.