public class ContributingRecorderElement extends AbstractMultipleRecorderElement
getContributing(int, RecorderElementFactory, int) or
getContributing(int) to directly access the subelements and thus,
only at the end of recording, the remaining methods in this class will be
called. These methods aim at evenly distributing the values to be recorded
to the subelements.| Modifier and Type | Field and Description |
|---|---|
private int |
count
Stores the number of variants (elements in
AbstractMultipleRecorderElement.elements may be
null, particularly during initialization or when automatic
variant detection is enabled). |
| Modifier | Constructor and Description |
|---|---|
protected |
ContributingRecorderElement(MonitoringGroupConfiguration conf)
Creates a recorder element.
|
| Modifier and Type | Method and Description |
|---|---|
void |
copy(RecorderElement from)
Copies the data stored in
from into this instance. |
protected RecorderElement |
createElement()
Creates a new subelement to be stored within this element (factory
method).
|
protected boolean |
enableRecording(RecorderElement elt,
ResourceType resource)
Returns whether the given element should record the specified resource.
|
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.
|
boolean |
hasDebugStates(DebugState state)
Returns if this instance has the given
state selected. |
addNetBytes, countAccountable, distributeIntValue, distributeLongValue, ensureSize, firstElement, getCpuTimeTicks, getElement, getElementCount, getFileIn, getFileOut, getIoRead, getIoWrite, getMemAllocated, getMemUse, getNetIn, getNetOut, getStartCpuTime, getStartSystemTime, getSystemTimeTicks, hasElement, memoryAllocated, memoryFreed, readIo, setCpuTimeTicks, setElement, startTimeRecording, stopTimeRecording, timeCorrection, updateMemoryFreedFromJvm, wasRecorded, writeIoaccountResource, checkConf, createForTest, getConfiguration, getGroupAccounting, getInstanceRecorderElement, getResources, getVarId, instanceRecorderElements, instanceRecorderIds, isIndirectAccounting, isVisible, setVarIdprivate int count
AbstractMultipleRecorderElement.elements may be
null, particularly during initialization or when automatic
variant detection is enabled).protected ContributingRecorderElement(MonitoringGroupConfiguration conf)
conf - the monitoring group configurationpublic void copy(RecorderElement from)
from into this instance. (Deep
copy)copy in class AbstractMultipleRecorderElementfrom - the instance from where to copy (may also be a subclass)protected RecorderElement createElement()
public boolean hasDebugStates(DebugState state)
state selected.hasDebugStates in class RecorderElementstate - the state to be testedtrue if the state is selected, false
elseRecorderElement 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 returnedjava.lang.ArrayIndexOutOfBoundsException - if
index<0 || index>=getContributingSize()public int getContributingSize()
getContributingSize in class RecorderElementprotected boolean enableRecording(RecorderElement elt, ResourceType resource)
enableRecording in class AbstractMultipleRecorderElementelt - the element to be consideredresource - the resource to be testedtrue if recording should be done,
false else