public abstract class RecorderFrontend
extends java.lang.Object
instance properly and
instrumented code needs to call methods of the recorder (frontend) via this
class.
Methods intended for Java monitoring are tagged with [Java call] and should
not be called during native monitoring. Methods tagged with [native call] are
intended for native monitoring and should not be called during Java
monitoring except of indirect calls from [Java call] methods or in case that
methods are tagged twice. We assume that System.nanoTime and
System.currentTimeMillis work properly in a native environment.
Required thread ids are indirectly obtained from
IThreadDataGatherer.getCurrentId(). In
case that the returned identifiers do not map to
native identifiers, replace the native implementation of
IThreadDataGatherer.
| Modifier and Type | Field and Description |
|---|---|
static RecorderFrontend |
instance
Stores the instance of this class.
|
| Constructor and Description |
|---|
RecorderFrontend() |
| Modifier and Type | Method and Description |
|---|---|
abstract 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. |
abstract void |
changeValueContext(java.lang.String id,
boolean push)
Notifies the recorder about changing the value context.
|
abstract void |
clearTemporaryData()
Notify that temporary data e.g. from instrumentation shall be cleared.
|
abstract void |
configurationChange(java.lang.String ids)
Notify the recorder that a new variability configuration might have
been entered.
|
abstract void |
enableVariabilityDetection(boolean enable)
Changes if automated variability detection should be enabled or not.
|
abstract void |
endSystem()
Notifies about the end of the monitored program.
|
abstract void |
enter(java.lang.String caller,
java.lang.String recId,
boolean exclude,
boolean directId,
long instanceId)
Notifies the recorder about a method being called.
|
abstract void |
exit(java.lang.String caller,
java.lang.String recId,
boolean exclude,
boolean directId,
long instanceId)
Notifies the recorder about a method being exited.
|
abstract void |
memoryAllocated(long tag,
long size)
Notifies the recorder about an object allocated to memory.
|
abstract void |
memoryAllocated(java.lang.Object allocated)
Notifies the recorder about an object allocated to memory.
|
abstract void |
memoryAllocated(java.lang.Object tag,
long size)
Notifies the recorder about an object allocated to memory.
|
abstract void |
memoryFreed(long tag,
long size)
Notifies the recorder about an object freed from memory.
|
abstract void |
memoryFreed(java.lang.Object freed)
Notifies the recorder about an object freed from memory.
|
abstract void |
memoryFreed(java.lang.Object tag,
long size)
Notifies the recorder about an object freed from memory.
|
abstract void |
notifyProgramEnd()
Notifies about end of monitoring (this might occur at different point
of time than
endSystem() and at multiple times). |
abstract void |
notifyProgramStart()
Notifies about start of monitoring.
|
abstract void |
notifyThreadEnd()
Notifies about the end of the current thread.
|
abstract void |
notifyThreadEnd(long newThreadId)
Notifies about an ended thread.
|
abstract void |
notifyThreadStart(long newThreadId)
Notifies about a started thread.
|
abstract void |
notifyThreadStart(java.lang.Thread thread)
Notifies about a started thread.
|
abstract void |
notifyTimer(java.lang.String id,
TimerState state,
boolean considerThreads)
Notifies about a timer event.
|
abstract void |
notifyValueChange(java.lang.String recId,
boolean newValue)
Notifies the recorder about a changing value.
|
abstract void |
notifyValueChange(java.lang.String recId,
byte newValue)
Notifies the recorder about a changing value.
|
abstract void |
notifyValueChange(java.lang.String recId,
char newValue)
Notifies the recorder about a changing value.
|
abstract void |
notifyValueChange(java.lang.String recId,
double newValue)
Notifies the recorder about a changing value.
|
abstract void |
notifyValueChange(java.lang.String recId,
float newValue)
Notifies the recorder about a changing value.
|
abstract void |
notifyValueChange(java.lang.String recId,
int newValue)
Notifies the recorder about a changing value.
|
abstract void |
notifyValueChange(java.lang.String recId,
long newValue)
Notifies the recorder about a changing value.
|
abstract void |
notifyValueChange(java.lang.String recId,
java.lang.Object newValue)
Notifies the recorder about a changing value.
|
abstract void |
notifyValueChange(java.lang.String recId,
short newValue)
Notifies the recorder about a changing value.
|
abstract void |
notifyValueChange(java.lang.String recId,
java.lang.String newValue)
Notifies the recorder about a changing value.
|
abstract void |
printCurrentState()
Prints the current (aggregated) state to the output formatter.
|
abstract void |
printStatistics()
Emits the values collected so far.
|
abstract 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.
|
abstract 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.
|
abstract 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.
|
abstract void |
registerForRecording(java.lang.String className,
MonitoringGroupSettings settings)
Registers a given class for recording.
|
abstract void |
registerThisThread(boolean register)
Registers a JVM thread with its native counterpart.
|
abstract 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.
|
public static RecorderFrontend instance
public abstract 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). [Java call, native call]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 abstract void registerAsOverheadStream(java.io.InputStream in)
in - the stream to be registeredpublic abstract void registerAsOverheadStream(java.io.OutputStream out)
out - the stream to be registeredpublic abstract void notifyProgramStart()
public abstract void notifyProgramEnd()
endSystem() and at multiple times). [Java call,
native call]public abstract 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 abstract void notifyThreadStart(java.lang.Thread thread)
thread - the started threadpublic abstract void notifyThreadStart(long newThreadId)
newThreadId - the identification of the started threadpublic abstract void notifyThreadEnd()
public abstract void notifyThreadEnd(long newThreadId)
newThreadId - the identification of the ended threadpublic abstract void assignAllTo(java.lang.String recId,
boolean enter)
recId. [Java call, native call]recId - the recording id (may be also the variability prefix)enter - true if this is a method enter event,
false elsepublic abstract void printStatistics()
public abstract void endSystem()
public abstract 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 abstract 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 abstract void configurationChange(java.lang.String ids)
ids - an optional list of group identificationspublic abstract void memoryAllocated(java.lang.Object allocated)
allocated - the allocatedpublic abstract 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 abstract void memoryAllocated(long tag,
long size)
tag - the identification of the memory object, e.g. its memory
addresssize - the allocated memory sizepublic abstract void memoryFreed(java.lang.Object freed)
Object cannot be instrumented, garbage collector not called
when JVM is running, etc.). [Java call]freed - the freed objectpublic abstract 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 abstract void memoryFreed(long tag,
long size)
Object cannot be instrumented, garbage collector not called
when JVM is running, etc.). [Java call, native call]tag - the identification of the object to be freed, e.g. its memory
addresssize - the size of the freed objectpublic abstract 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 abstract 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 abstract 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 abstract 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 abstract void notifyValueChange(java.lang.String recId,
int newValue)
recId - the recorder id (optional, may be null)newValue - the value after the value changepublic abstract void notifyValueChange(java.lang.String recId,
byte newValue)
recId - the recorder id (optional, may be null)newValue - the value after the value changepublic abstract void notifyValueChange(java.lang.String recId,
char newValue)
recId - the recorder id (optional, may be null)newValue - the value after the value changepublic abstract void notifyValueChange(java.lang.String recId,
short newValue)
recId - the recorder id (optional, may be null)newValue - the value after the value changepublic abstract void notifyValueChange(java.lang.String recId,
long newValue)
recId - the recorder id (optional, may be null)newValue - the value after the value changepublic abstract void notifyValueChange(java.lang.String recId,
double newValue)
recId - the recorder id (optional, may be null)newValue - the value after the value changepublic abstract void notifyValueChange(java.lang.String recId,
float newValue)
recId - the recorder id (optional, may be null)newValue - the value after the value changepublic abstract 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 abstract void notifyValueChange(java.lang.String recId,
boolean newValue)
recId - the recorder id (optional, may be null)newValue - the value after the value changepublic abstract void printCurrentState()
public abstract 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 abstract void registerThisThread(boolean register)
register - register or unregister the threadpublic abstract void clearTemporaryData()