public class RecorderAccess
extends java.lang.Object
RecorderFrontend. This is needed because
calls to the recorder before recording is started would otherwise result
in a NullPointerException. Conversely, the recorder
RecorderFrontend is needed in order to hide the dependencies of the
concrete implementation which would lead to a dependency cycle while
instrumentation and class loading.| Modifier | Constructor and Description |
|---|---|
private |
RecorderAccess()
Prevents this class from being instantiated from outside.
|
| Modifier and Type | Method and Description |
|---|---|
static void |
assignAllTo(java.lang.String recId,
boolean enter)
Notifies that the following values (if not further calls
to this method or other recording ids occur) should be assigned
to the given
recId. |
static void |
changeValueContext(java.lang.String id,
boolean push)
Notifies the recorder about changing the value context.
|
static void |
configurationChange(java.lang.String ids)
Notify the recorder that a new variability configuration might have
been entered.
|
static void |
enableVariabilityDetection(boolean enable)
Changes if automated variability detection should be enabled or not.
|
static void |
endSystem()
Notifies about the end of the monitored program.
|
static void |
enter(java.lang.String caller,
java.lang.String recId,
boolean exclude,
boolean directId,
long instanceId)
Notifies the recorder about a method being called.
|
static void |
exit(java.lang.String caller,
java.lang.String recId,
boolean exclude,
boolean directId,
long instanceId)
Notifies the recorder about a method being exited.
|
static void |
memoryAllocated(java.lang.Object allocated)
Notifies the recorder about an object allocated to memory.
|
static void |
memoryAllocated(java.lang.Object tag,
long size)
Notifies the recorder about an object allocated to memory.
|
static void |
memoryFreed(long tag,
long size)
Notifies the recorder about an object freed from memory.
|
static void |
memoryFreed(java.lang.Object freed)
Notifies the recorder about an object freed from memory.
|
static void |
memoryFreed(java.lang.Object tag,
long size)
Notifies the recorder about an object freed from memory.
|
static void |
notifyProgramEnd()
Notifies about end of monitoring (this might occur at different point
of time than
endSystem() and at multiple times). |
static void |
notifyProgramStart()
Notifies about start of monitoring.
|
static void |
notifyThreadEnd()
Notifies about the end of the current thread.
|
void |
notifyThreadEnd(long threadId)
Notifies about an ended thread.
|
static void |
notifyThreadStart(java.lang.Thread thread)
Notifies about a started thread.
|
static void |
notifyTimer(java.lang.String id,
TimerState state,
boolean considerThreads)
Notifies about a timer event.
|
static void |
notifyValueChange(java.lang.String recId,
boolean newValue)
Notifies the recorder about a changing value.
|
static void |
notifyValueChange(java.lang.String recId,
byte newValue)
Notifies the recorder about a changing value.
|
static void |
notifyValueChange(java.lang.String recId,
char newValue)
Notifies the recorder about a changing value.
|
static void |
notifyValueChange(java.lang.String recId,
double newValue)
Notifies the recorder about a changing value.
|
static void |
notifyValueChange(java.lang.String recId,
float newValue)
Notifies the recorder about a changing value.
|
static void |
notifyValueChange(java.lang.String recId,
int newValue)
Notifies the recorder about a changing value.
|
static void |
notifyValueChange(java.lang.String recId,
long newValue)
Notifies the recorder about a changing value.
|
static void |
notifyValueChange(java.lang.String recId,
java.lang.Object newValue)
Notifies the recorder about a changing value.
|
static void |
notifyValueChange(java.lang.String recId,
short newValue)
Notifies the recorder about a changing value.
|
static void |
notifyValueChange(java.lang.String recId,
java.lang.String newValue)
Notifies the recorder about a changing value.
|
static void |
printCurrentState()
Prints the current (aggregated) state to the output formatter.
|
static void |
printStatistics()
Emits the values collected so far.
|
static int |
readIo(java.lang.String recId,
java.lang.String caller,
int bytes,
StreamType type)
Notifies the recorder about an amount of bytes read from some I/O
channel.
|
static void |
registerAsOverheadStream(java.io.InputStream in)
Register the given input stream as overhead stream, i.e. set the
attribute added by instrumentation via reflection so that the recorder
is notified.
|
static void |
registerAsOverheadStream(java.io.OutputStream out)
Register the given output stream as overhead stream, i.e. set the
attribute added by instrumentation via reflection so that the recorder
is notified.
|
static void |
registerForRecording(java.lang.String className,
MonitoringGroupSettings settings)
Registers a given class for recording.
|
static void |
registerThisThread(boolean register)
Registers a JVM thread with its native counterpart.
|
static int |
writeIo(java.lang.String recId,
java.lang.String caller,
int bytes,
StreamType type)
Notifies the recorder about an amount of bytes written to some I/O
channel.
|
private RecorderAccess()
public static void registerForRecording(java.lang.String className,
MonitoringGroupSettings settings)
ids might be specified to which the measurements are
assigned to. Ids are unique strings without inherent semantics. If
not given, the className is used for grouping and assigning
measurements (implicit 1-groups).className - the name of the class measurements should be registered
forsettings - the monitoring group settings including all configuration
information (reference should not be stored, will be freed
explicitly)public static void registerAsOverheadStream(java.io.InputStream in)
in - the stream to be registeredpublic static void registerAsOverheadStream(java.io.OutputStream out)
out - the stream to be registeredpublic static void notifyProgramStart()
public static void notifyProgramEnd()
endSystem() and at multiple times).public static void enableVariabilityDetection(boolean enable)
enable - true if it should be enabled (can be
switched off by annotation) or if manual notification via annotation
should be considered onlypublic static void notifyThreadStart(java.lang.Thread thread)
thread - the started threadpublic static final void notifyThreadEnd()
public final void notifyThreadEnd(long threadId)
threadId - the identification of the ended threadpublic static void assignAllTo(java.lang.String recId,
boolean enter)
recId.recId - the recording id (may be also the variability prefix)enter - true if this is a method enter event,
false elsepublic static void printStatistics()
public static void endSystem()
public static void enter(java.lang.String caller,
java.lang.String recId,
boolean exclude,
boolean directId,
long instanceId)
caller - the type of the callerrecId - the recorder id (may be null)exclude - is this an exclusion from monitoringdirectId - is recId direct, e.g. in case of an
annotated methodinstanceId - the optional instance identifier, 0 means
disabledpublic static void exit(java.lang.String caller,
java.lang.String recId,
boolean exclude,
boolean directId,
long instanceId)
caller - the type of the callerrecId - the recorder id (may be null)exclude - is this an exclusion from monitoringdirectId - is recId direct, e.g. in case of an
annotated methodinstanceId - the optional instance identifier, 0 means
disabledpublic static void configurationChange(java.lang.String ids)
ids - an optional list of group identificationspublic static void memoryAllocated(java.lang.Object tag,
long size)
tag - an object which serves as the identification for object size
to be freedsize - the allocated memory sizepublic static void memoryAllocated(java.lang.Object allocated)
allocated - the allocatedpublic static void memoryFreed(java.lang.Object tag,
long size)
tag - an object which serves as the identification for object size
to be freedsize - the size of the freed objectpublic static void memoryFreed(java.lang.Object freed)
Object cannot be instrumented, garbage collector not called
when JVM is running, etc.).freed - the freed objectpublic static void memoryFreed(long tag,
long size)
Object cannot be instrumented, garbage collector not called
when JVM is running, etc.).tag - the identification of the object to be freedsize - the size of the freed objectpublic static int readIo(java.lang.String recId,
java.lang.String caller,
int bytes,
StreamType type)
recId - an the target group identificationcaller - the type of the callerbytes - the number of bytestype - the type of the channelpublic static int writeIo(java.lang.String recId,
java.lang.String caller,
int bytes,
StreamType type)
recId - an the target group identificationcaller - the type of the callerbytes - the number of bytestype - the type of the channelpublic static void changeValueContext(java.lang.String id,
boolean push)
id - the value identification representing the contextpush - if true push the context to the context stack,
false elsepublic static void notifyValueChange(java.lang.String recId,
java.lang.Object newValue)
recId - the recorder id (optional, may be null)newValue - the value after the value changepublic static void notifyValueChange(java.lang.String recId,
int newValue)
recId - the recorder id (optional, may be null)newValue - the value after the value changepublic static void notifyValueChange(java.lang.String recId,
byte newValue)
recId - the recorder id (optional, may be null)newValue - the value after the value changepublic static void notifyValueChange(java.lang.String recId,
char newValue)
recId - the recorder id (optional, may be null)newValue - the value after the value changepublic static void notifyValueChange(java.lang.String recId,
short newValue)
recId - the recorder id (optional, may be null)newValue - the value after the value changepublic static void notifyValueChange(java.lang.String recId,
long newValue)
recId - the recorder id (optional, may be null)newValue - the value after the value changepublic static void notifyValueChange(java.lang.String recId,
double newValue)
recId - the recorder id (optional, may be null)newValue - the value after the value changepublic static void notifyValueChange(java.lang.String recId,
float newValue)
recId - the recorder id (optional, may be null)newValue - the value after the value changepublic static void notifyValueChange(java.lang.String recId,
java.lang.String newValue)
recId - the recorder id (optional, may be null)newValue - the value after the value changepublic static void notifyValueChange(java.lang.String recId,
boolean newValue)
recId - the recorder id (optional, may be null)newValue - the value after the value changepublic static void printCurrentState()
public static void notifyTimer(java.lang.String id,
TimerState state,
boolean considerThreads)
id - the timer identification (may overlap with recorder ids)state - the new timer stateconsiderThreads - false if the id is
thread save and threads must not be considered explicitly,
false elsepublic static void registerThisThread(boolean register)
register - register or unregister the thread