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 SampleModel
public StatisticExpression getPeakTPSExpression()
getPeakTPSExpression
in interface SampleModel
public void registerTests(Collection<Test> tests)
registerTests
in interface SampleModel
tests
- The new tests.public StatisticsSet getTotalCumulativeStatistics()
getTotalCumulativeStatistics
in interface SampleModel
public StatisticsSet getTotalLatestStatistics()
getTotalLatestStatistics
in interface SampleModel
public void addModelListener(SampleModel.Listener listener)
addModelListener
in interface SampleModel
listener
- The listener.public void addSampleListener(Test test, SampleListener listener)
addSampleListener
in interface SampleModel
test
- The test to add the sample listener for.listener
- The sample listener.public void addTotalSampleListener(SampleListener listener)
addTotalSampleListener
in interface SampleModel
listener
- The sample listener.public void reset()
This doesn't change the model state.
reset
in interface SampleModel
public void zeroStatistics()
zeroStatistics
in interface SampleModel
public void start()
start
in interface SampleModel
public void stop()
stop
in interface SampleModel
public void addTestReport(TestStatisticsMap testStatisticsMap)
addTestReport
in interface SampleModel
testStatisticsMap
- The new test statistics.public SampleModel.State getState()
getState
in interface SampleModel
Copyright © 2000-2014. All Rights Reserved.