public interface RecorderStrategy
| Modifier and Type | Field and Description |
|---|---|
static int |
REGISTER_END
Force thread end.
|
static int |
REGISTER_FORCE
Force thread registration.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
assignAllTo(java.lang.String recId,
boolean enter,
long now,
ThreadsInfo threadInfo)
Notifies that the following values (if not further calls
to this method or other recording ids occur) should be assigned
to the given
recId. |
void |
clearTemporaryData()
Notify that temporary data e.g. from instrumentation shall be cleared.
|
void |
enableVariabilityDetection(boolean enable)
Enables or disables automatic variability detection.
|
void |
endSystem()
Called as the last event from the monitored program.
|
boolean |
enter(java.lang.String recId,
long now,
ThreadsInfo threadsInfo,
boolean exclude)
Notifies the recorder about a method being called.
|
void |
enterConfiguration(java.lang.String id)
Notify the recorder that a new variability configuration might have
been entered.
|
boolean |
exit(java.lang.String recId,
long now,
ThreadsInfo threadsInfo,
boolean exclude)
Notifies the recorder about a method being exited.
|
boolean |
finishRecording(long now,
long threadId,
LongLongHashMap curCpuTime)
Notifies this strategy that recording should be stopped (second stage
of stopping the recorder).
|
java.lang.String |
getRecorderId(java.lang.String className)
Maps a class name to its recorder id (called in this interface usually
recId). |
StrategyStorage |
getStorage()
Returns the attached storage.
|
char |
getVariabilitySeparatorChar()
Returns the char used for separating the variability id and its
current value (in configurations).
|
boolean |
isVariabilityDetectionEnabled()
Returns if automatic variability detection is enabled.
|
void |
memoryAllocated(java.lang.String recId,
long threadId,
long id,
long size)
Notifies the recorder about an object allocated to memory.
|
void |
memoryFreedByRecId(java.lang.String recId,
long size)
Notifies the recorder about an object freed from memory.
|
void |
notifyProgramRecordCreation()
Notify the listeners about the program record creation (if not done
implicitly before).
|
void |
notifyTimer(java.lang.String id,
TimerState state,
long now,
long threadId)
Notifies about a timer event.
|
void |
notifyValueChange(java.lang.String id,
ValueType type,
java.lang.Object value)
Notifies about a changing attribute value.
|
boolean |
printCurrentState(ProcessData data)
Prints the current (aggregated) state to the output formatter.
|
boolean |
printStatistics(ProcessData data)
Emits the values collected so far.
|
void |
readIo(java.lang.String recId,
java.lang.String caller,
long threadId,
int bytes,
StreamType type)
Notifies the recorder about an amount of bytes read from some I/O
channel.
|
void |
register(long threadId,
long newId,
long threadTicks,
long now)
Registers a thread id with a recording id.
|
void |
registerForRecording(java.lang.String className,
java.lang.String recId,
MonitoringGroupConfiguration conf,
MonitoringGroupSettings settings)
Registers a given class for recording.
|
void |
startRecording(long now,
long threadId,
long threadTicks)
Notifies this strategy that recording should be start.
|
boolean |
stopTimeRecording(long now,
ThreadsInfo threadsInfo)
Notifies this strategy that time recording should be stopped (first
stage of stopping the recorder).
|
void |
writeIo(java.lang.String recId,
java.lang.String caller,
long threadId,
int bytes,
StreamType type)
Notifies the recorder about an amount of bytes written to some I/O
channel.
|
static final int REGISTER_FORCE
register(long, long, long, long)static final int REGISTER_END
register(long, long, long, long)void writeIo(java.lang.String recId,
java.lang.String caller,
long threadId,
int bytes,
StreamType type)
recId - a unique identification where to assign this event tocaller - optional class name of the calling classthreadId - the identification of the calling threadbytes - the number of bytestype - the type of the channelvoid readIo(java.lang.String recId,
java.lang.String caller,
long threadId,
int bytes,
StreamType type)
recId - a unique identification where to assign this event tocaller - optional class name of the calling classthreadId - the identification of the calling threadbytes - the number of bytestype - the type of the channelvoid memoryFreedByRecId(java.lang.String recId,
long size)
Object cannot be instrumented).recId - a unique identification where to assign this event tosize - the affected amount of bytes in memoryvoid memoryAllocated(java.lang.String recId,
long threadId,
long id,
long size)
recId - a unique identification where to assign this event tothreadId - the identification of the calling threadid - the unique identification of the object being allocatedsize - the affected amount of bytes in memoryboolean exit(java.lang.String recId,
long now,
ThreadsInfo threadsInfo,
boolean exclude)
recId - a unique identification where to assign this event tonow - the current time in nano secondsthreadsInfo - information on the currently running threadsexclude - is this an exclusion from monitoringtrue if the threadsInfo object should be released
to the pool, false if it should not be releasedvoid register(long threadId,
long newId,
long threadTicks,
long now)
threadId - the read id to be recordednewId - REGISTER_FORCE the thread specified by
threadId and threadTicks is registered
with the recorderREGISTER_END the thread specified by
threadId and threadTicks is marked as
terminated in the recorderthreadTicks - the ticks of threadIdnow - the current time in nano secondsboolean enter(java.lang.String recId,
long now,
ThreadsInfo threadsInfo,
boolean exclude)
recId - a unique identification where to assign this event tonow - the current system time in nano secondsthreadsInfo - information on the currently running threadsexclude - is this an exclusion from monitoringtrue if the threadsInfo object should be released
to the pool, false if it should not be releasedboolean assignAllTo(java.lang.String recId,
boolean enter,
long now,
ThreadsInfo threadInfo)
recId.recId - the recording id (may be also the variability prefix)enter - true if this is a method enter event,
false elsenow - the current system timethreadInfo - information on the current threadtrue if the threadsInfo object should be released
to the pool, false if it should not be releasedboolean printStatistics(ProcessData data)
data - additional information collected for system and JVM processtrue if the data object should be released
to the pool, false if it should not be releasedvoid endSystem()
finishRecording(long, long, de.uni_hildesheim.sse.monitoring.runtime.utils.LongLongHashMap) and optionally
printStatistics(de.uni_hildesheim.sse.monitoring.runtime.recordingStrategies.ProcessData).boolean stopTimeRecording(long now,
ThreadsInfo threadsInfo)
now - the current time in nano secondsthreadsInfo - information on the currently running threadstrue if the threadsInfo object should be released
to the pool, false if it should not be releasedboolean finishRecording(long now,
long threadId,
LongLongHashMap curCpuTime)
now - the current time in nano secondsthreadId - the id of the current threadcurCpuTime - the id-cpu time mapping of all threadstrue if the curCpuTime object should be released
to the pool, false if it should not be releasedvoid startRecording(long now,
long threadId,
long threadTicks)
now - the current time in nano secondsthreadId - the thread id of the executing (main) threadthreadTicks - the thread ticks for threadIdvoid registerForRecording(java.lang.String className,
java.lang.String recId,
MonitoringGroupConfiguration conf,
MonitoringGroupSettings settings)
id 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
forrecId - an optional group identification (may be empty or
null)conf - additional configuration for the monitoring group derived
from settingssettings - the monitoring group settings including all configuration
information (reference should not be stored, will be freed
explicitly)void enterConfiguration(java.lang.String id)
id - an optional group identification (may be empty or null)java.lang.String getRecorderId(java.lang.String className)
recId).className - the class name to be mappedclassNamechar getVariabilitySeparatorChar()
void enableVariabilityDetection(boolean enable)
enable - true if variability detection should be
enabled, false elseboolean isVariabilityDetectionEnabled()
true if variability detection should be
enabled, false elseboolean printCurrentState(ProcessData data)
data - additional information collected for system and JVM process (may be null)true if the threadsInfo object should be released
to the pool, false if it should not be releasedvoid notifyTimer(java.lang.String id,
TimerState state,
long now,
long threadId)
id - the timer identification (may overlap with recorder ids)state - the new timer statenow - the current system time in millisecondsthreadId - the id of the currently executing thread, may be
negative if it should be ignoredvoid notifyValueChange(java.lang.String id,
ValueType type,
java.lang.Object value)
id - the identification of the attribute (may overlap with
recorder ids)type - the type of the valuevalue - the new value (after changing)void notifyProgramRecordCreation()
void clearTemporaryData()
StrategyStorage getStorage()