public class BlockingRecorderElement extends RecorderElement
| Modifier | Constructor and Description |
|---|---|
protected |
BlockingRecorderElement()
Creates a recorder element.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
accountResource(ResourceType type)
Returns whether the specified resource should be accounted.
|
(package private) void |
addNetBytes(long netInBytes,
long netOutBytes)
Adds an external amount of input or output bytes to this recording
element.
|
RecorderElement |
getContributing(int index)
Returns a contributing recording element, i.e. one of the elements
assigned to individual variants in a variability configuration.
|
(package private) RecorderElement |
getContributing(int index,
RecorderElementFactory factory,
int max)
Returns the currently relevant recorder element (in case that
multiple subelements are supported).
|
int |
getContributingSize()
Returns the number of contributing recording elements, i.e. the elements
recording individual variants in a variability configuration.
|
long |
getCpuTimeTicks()
Returns the entire number of CPU time ticks recorded for this
instance.
|
long |
getFileIn()
Returns the number of bytes read from files.
|
long |
getFileOut()
Returns the number of bytes written to files.
|
GroupAccountingType |
getGroupAccounting()
Stores the accounting type.
|
long |
getIoRead()
Returns the number of bytes read from files or network.
|
long |
getIoWrite()
Returns the number of bytes written to files or network.
|
long |
getMemAllocated()
Returns the amount of memory allocated for this instance.
|
long |
getMemUse()
Returns the amount of memory currently being used, i.e. difference
between allocated and unallocated memory.
|
long |
getNetIn()
Returns the number of bytes read from network.
|
long |
getNetOut()
Returns the number of bytes written to network.
|
ResourceType[] |
getResources()
Stores the resources to be accounted.
|
long |
getStartCpuTime(long threadId)
Returns the CPU time when recording was started.
|
long |
getStartSystemTime(long threadId)
Returns the system time when recording was started.
|
long |
getSystemTimeTicks()
Returns the entire number of system time ticks recorded for this
instance.
|
boolean |
hasDebugStates(DebugState state)
Returns if this instance has the given
state selected. |
boolean |
isIndirectAccounting()
Returns whether indirect accounting is activated, either in this
instance or (if
RecorderElement.getGroupAccounting() is GroupAccountingType.DEFAULT)
than in Configuration.getGroupAccountingType(). |
(package private) void |
memoryAllocated(long size)
Records an amount of memory allocated by the underlying recording group.
|
(package private) void |
memoryFreed(long size)
Records an amount of memory freed within the underlying recording
group (memory unallocation).
|
(package private) void |
readIo(int bytes,
StreamType type)
Records an amount of bytes read from file or from network.
|
(package private) void |
setCpuTimeTicks(long cpuTimeTicks)
Sets the current CPU time ticks for finishing recording of the entire
program.
|
(package private) boolean |
startTimeRecording(long nanoTime,
long threadTicks,
long threadId)
Start the time recording for this instance.
|
(package private) boolean |
stopTimeRecording(long nanoTime,
long threadTicks,
long threadId)
Stops the time recording for this instance.
|
(package private) void |
timeCorrection(long timeDiff,
long threadTimeFraction,
boolean decrement,
long threadId)
Adds (overhead) time correction information.
|
(package private) void |
updateMemoryFreedFromJvm()
Updates freed memory from the JVM instead of recording this information
individually (memory unallocation).
|
boolean |
wasRecorded()
Returns if data on this instance was recorded or if it a dummy instance
created e.g. for some unused (automatic detected) variants.
|
(package private) void |
writeIo(int bytes,
StreamType type)
Records an amount of bytes written to file or from network.
|
checkConf, copy, createForTest, getConfiguration, getInstanceRecorderElement, getVarId, instanceRecorderElements, instanceRecorderIds, isVisible, setVarIdprotected BlockingRecorderElement()
public boolean wasRecorded()
true if valid data was recorded, false
elsepublic long getSystemTimeTicks()
public long getCpuTimeTicks()
public long getMemAllocated()
public long getMemUse()
public long getStartCpuTime(long threadId)
getStartCpuTime in class RecorderElementthreadId - the identifier of the thread the start time should be
returned forpublic long getStartSystemTime(long threadId)
getStartSystemTime in class RecorderElementthreadId - the identifier of the thread the start time should be
returned forpublic long getIoRead()
public long getIoWrite()
public long getNetIn()
public long getNetOut()
public long getFileIn()
public long getFileOut()
boolean startTimeRecording(long nanoTime,
long threadTicks,
long threadId)
startTimeRecording in class RecorderElementnanoTime - the current system time in nano secondsthreadTicks - the current number of thread ticksthreadId - the identifier of the thread causing the calltrue if recording started on this instance with
this call, false if recording was yet active, e.g. in
case of recursive or reentrant callsboolean stopTimeRecording(long nanoTime,
long threadTicks,
long threadId)
stopTimeRecording in class RecorderElementnanoTime - the current system time in nano secondsthreadTicks - the current number of thread ticksthreadId - the identifier of the thread causing the calltrue if recording stopped on this instance with
this call, false if recording is still active, e.g. in
case of recursive or reentrant calls, a negative value causes
stopping time recording for all stored threaded timesvoid memoryAllocated(long size)
memoryAllocated in class RecorderElementsize - the amount of memory allocatedvoid memoryFreed(long size)
memoryFreed in class RecorderElementsize - the amount of memory freedvoid updateMemoryFreedFromJvm()
updateMemoryFreedFromJvm in class RecorderElementvoid readIo(int bytes,
StreamType type)
readIo in class RecorderElementbytes - the amount of bytes readtype - the type of stream used for readingvoid writeIo(int bytes,
StreamType type)
writeIo in class RecorderElementbytes - the amount of bytes writtentype - the type of stream used for writingvoid setCpuTimeTicks(long cpuTimeTicks)
setCpuTimeTicks in class RecorderElementcpuTimeTicks - the current CPU time ticksvoid addNetBytes(long netInBytes,
long netOutBytes)
addNetBytes in class RecorderElementnetInBytes - the amount of bytes read from networknetOutBytes - the amount of bytes written to networkvoid timeCorrection(long timeDiff,
long threadTimeFraction,
boolean decrement,
long threadId)
timeCorrection in class RecorderElementtimeDiff - time differencethreadTimeFraction - threaded time fractiondecrement - negative or positive correctionthreadId - the thread id of the causing threadRecorderElement getContributing(int index, RecorderElementFactory factory, int max)
getContributing in class RecorderElementindex - the index of the sub element (may be negative if not known)factory - a factory to create new elements if neededmax - the (current) number of maximum required subelements
(variabilities)public RecorderElement getContributing(int index)
getContributing in class RecorderElementindex - the element to be returnedpublic int getContributingSize()
getContributingSize in class RecorderElementpublic boolean isIndirectAccounting()
RecorderElement.getGroupAccounting() is GroupAccountingType.DEFAULT)
than in Configuration.getGroupAccountingType().isIndirectAccounting in class RecorderElementtrue if indirect is activated,
false elsepublic boolean accountResource(ResourceType type)
accountResource in class RecorderElementtype - the type of the resource to query fortrue if it should be accounted,
false elsepublic GroupAccountingType getGroupAccounting()
getGroupAccounting in class RecorderElementpublic ResourceType[] getResources()
getResources in class RecorderElementpublic boolean hasDebugStates(DebugState state)
state selected.hasDebugStates in class RecorderElementstate - the state to be testedtrue if the state is selected, false
else