public abstract class RuntimeMeasurements extends Object
A listener is installed by an organizer, and activated at thread switch time by Thread. Depending on the update method that the listener supports, it can be either a method, context, or a null listener. Currently we have different registries for different listeners. An alternative design is to have one register with where entries are tagged.
A decayable object implements the Decayable interface. Anyone can register a decayable object, The DecayOrganizer periodically decays all objects that have been registers.
A reportable object implements the Reportable interface, and is typically registered and used by the instrumentation subsystem. A Reporable can be reset and reported.
Modifier and Type | Field and Description |
---|---|
private static ContextListener[] |
cbsContextListeners
context listeners that trigger on CBS call yieldpoints
|
private static MethodListener[] |
cbsMethodListeners
method listeners that trigger on CBS Method yieldpoints
|
(package private) static int |
decayEventCounter
Counts the number of decay events
|
(package private) static Vector<Decayable> |
decayObjects
The currently registered decayable objects
|
(package private) static Vector<Reportable> |
reportObjects
The currently registered reportable objects
|
private static ContextListener[] |
timerContextListeners
listeners on timer ticks for contexts
|
private static MethodListener[] |
timerMethodListeners
listeners on timer ticks for methods
|
private static NullListener[] |
timerNullListeners
listeners on timer ticks for nulls
|
Constructor and Description |
---|
RuntimeMeasurements() |
Modifier and Type | Method and Description |
---|---|
static void |
boot()
Called when the VM is booting
|
static void |
decayDecayableObjects()
Decays all registered decayable objects.
|
static void |
installCBSContextListener(ContextListener s)
Install a context listener on CBS ticks
|
static void |
installCBSMethodListener(MethodListener s)
Install a method listener on CBS ticks
|
static void |
installTimerContextListener(ContextListener s)
Install a context listener on timer ticks
|
static void |
installTimerMethodListener(MethodListener s)
Install a method listener on timer ticks
|
static void |
installTimerNullListener(NullListener s)
Install a null listener on timer ticks
|
static void |
registerDecayableObject(Decayable obj)
Registers an object that should be decayed.
|
static void |
registerReportableObject(Reportable obj)
Registers an object that wants to have its report method called
whenever RuntimeMeasurements.report is called.
|
static void |
report()
Reports the current state of runtime measurements.
|
private static void |
reportReportableObjects()
Calls
Reportable.report() on all registered reportable
objects. |
static void |
resetReportableObjects()
Calls
Reportable.reset() on all registered reportable
objects. |
static void |
stop()
Stop the runtime measurement subsystem
|
static void |
takeCBSCallSample(int whereFrom,
Address yieldpointServiceMethodFP)
Called from Thread.yieldpoint when it is time to take a CBS call sample.
|
static void |
takeCBSMethodSample(int whereFrom,
Address yieldpointServiceMethodFP)
Called from Thread.yieldpoint when it is time to take a CBS method sample.
|
static void |
takeTimerSample(int whereFrom,
Address yieldpointServiceMethodFP)
Called from Thread.yieldpoint every time it is invoked due to
a timer interrupt.
|
private static MethodListener[] timerMethodListeners
private static ContextListener[] timerContextListeners
private static NullListener[] timerNullListeners
private static MethodListener[] cbsMethodListeners
private static ContextListener[] cbsContextListeners
static final Vector<Decayable> decayObjects
static int decayEventCounter
static Vector<Reportable> reportObjects
public RuntimeMeasurements()
public static void installTimerMethodListener(MethodListener s)
s
- method listener to be installedpublic static void installTimerContextListener(ContextListener s)
s
- context listener to be installedpublic static void installTimerNullListener(NullListener s)
s
- null listener to be installedpublic static void takeTimerSample(int whereFrom, Address yieldpointServiceMethodFP)
whereFrom
- source of the yieldpoint (e.g. backedge)yieldpointServiceMethodFP
- the frame pointer of the service
method that is responsible for handling the yieldpointpublic static void installCBSMethodListener(MethodListener s)
s
- method listener to be installedpublic static void installCBSContextListener(ContextListener s)
s
- context listener to be installedpublic static void takeCBSMethodSample(int whereFrom, Address yieldpointServiceMethodFP)
whereFrom
- source of the yieldpoint (e.g. backedge)yieldpointServiceMethodFP
- the frame pointer of the service
method that is responsible for handling the yieldpointpublic static void takeCBSCallSample(int whereFrom, Address yieldpointServiceMethodFP)
whereFrom
- source of the yieldpoint (e.g. backedge)yieldpointServiceMethodFP
- the frame pointer of the service
method that is responsible for handling the yieldpointpublic static void registerDecayableObject(Decayable obj)
obj
- the object to decaypublic static void decayDecayableObjects()
public static void registerReportableObject(Reportable obj)
obj
- the object to report aboutpublic static void resetReportableObjects()
Reportable.reset()
on all registered reportable
objects.private static void reportReportableObjects()
Reportable.report()
on all registered reportable
objects.public static void report()
public static void stop()
public static void boot()