spec.harness.analyzer
Class CallbackAnalyzerExample

java.lang.Object
  extended by spec.harness.analyzer.AnalyzerBase
      extended by spec.harness.analyzer.CallbackAnalyzerExample

public class CallbackAnalyzerExample
extends AnalyzerBase

This Analyzer is an example of an Analyzer that is based on a callback mechanism available in the SPECjvm2008 analyzer functionality. The harness will call the method execute at a regular time interval, but it will not do anything in this case, just run the empty version of it. Instead the Analyzer is listening on call backs from some other system and adds the info to the iteration result. This Analyzer type is good to use when you want to log events, for example listening to the garbage collector or code generator. In this example data will be gathered from a simulated outer source which started as a thread in this class. So it is a contrived example. It will also report results as summaries of the events gathered throughout the iteration. This is available in the result raw file afterwards.


Nested Class Summary
static class CallbackAnalyzerExample.NumberInfo
           
static class CallbackAnalyzerExample.NumberResult
           
static class CallbackAnalyzerExample.TheNumberGenerator
          This is a number generator which will calculate somewhat random numbers.
 
Constructor Summary
CallbackAnalyzerExample()
           
 
Method Summary
 void callbackMethod(int value)
           
 void endMeasurementInterval()
          This method is called at the end of the measurement interval.
 void execute(long time)
          Execution method called at regular intervals for polling stats.
 void setup()
          Setup method called when analyzer is created.
 void startMeasurementInterval()
          This method is called at the start of the measurement interval.
 void tearDown()
          Tear down method called when analyzer is brought down.
 
Methods inherited from class spec.harness.analyzer.AnalyzerBase
addError, addErrorToSuiteResult, addViolationToSuiteResult, getBenchmarkDuration, getBenchmarkName, getNoOps, isTimedRun, report, report, setIterationResult, setupAnalyzerClass, tearDownAnalyzerClass
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CallbackAnalyzerExample

public CallbackAnalyzerExample()
Method Detail

execute

public void execute(long time)
Description copied from class: AnalyzerBase
Execution method called at regular intervals for polling stats.

Specified by:
execute in class AnalyzerBase
Parameters:
time - when the call is made

setup

public void setup()
Description copied from class: AnalyzerBase
Setup method called when analyzer is created. Initiation work should be done in this one. This is done once per iteration, each time in a new Analyzer instance.

Overrides:
setup in class AnalyzerBase

startMeasurementInterval

public void startMeasurementInterval()
Description copied from class: AnalyzerBase
This method is called at the start of the measurement interval. It is called by the ProgramRunner thread.

Overrides:
startMeasurementInterval in class AnalyzerBase

endMeasurementInterval

public void endMeasurementInterval()
Description copied from class: AnalyzerBase
This method is called at the end of the measurement interval. It is called by the ProgramRunner thread.

Overrides:
endMeasurementInterval in class AnalyzerBase

tearDown

public void tearDown()
Description copied from class: AnalyzerBase
Tear down method called when analyzer is brought down. Reporting work should be done in this one. This is done once per iteration, each time in a new Analyzer instance.

Overrides:
tearDown in class AnalyzerBase

callbackMethod

public void callbackMethod(int value)