org.jikesrvm.adaptive.measurements.listeners
Class YieldCounterListener

java.lang.Object
  extended by org.jikesrvm.adaptive.measurements.listeners.Listener
      extended by org.jikesrvm.adaptive.measurements.listeners.NullListener
          extended by org.jikesrvm.adaptive.measurements.listeners.YieldCounterListener

public final class YieldCounterListener
extends NullListener

A YieldCounterListener samples yield points, and notifies an Organizer when a threshold is reached. In effect, this class provides a way to "wake up" an infrequent service periodically.


Field Summary
private  int numYields
           
private  int totalYields
           
private  int yieldThreshold
           
 
Constructor Summary
YieldCounterListener(int yieldThreshold)
          Constructor
 
Method Summary
 void report()
          Entry point to dump what has been collected.
 void reset()
          reset the listeners data structures
 void update(int whereFrom)
          This method is called when its time to record that a yield point has occurred.
 
Methods inherited from class org.jikesrvm.adaptive.measurements.listeners.Listener
activate, activateOrganizer, isActive, passivate, setOrganizer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

yieldThreshold

private int yieldThreshold

numYields

private int numYields

totalYields

private int totalYields
Constructor Detail

YieldCounterListener

public YieldCounterListener(int yieldThreshold)
Constructor

Parameters:
yieldThreshold - the threshold of when to call organizer
Method Detail

update

public void update(int whereFrom)
This method is called when its time to record that a yield point has occurred.

Specified by:
update in class NullListener
Parameters:
whereFrom - Was this a yieldpoint in a PROLOGUE, BACKEDGE, or EPILOGUE?

report

public void report()
Description copied from class: Listener
Entry point to dump what has been collected.

Specified by:
report in class Listener

reset

public void reset()
Description copied from class: Listener
reset the listeners data structures

Specified by:
reset in class Listener