public class Configuration
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private ResourceType[] |
accountableResources
Stores the accountable resources (currently all).
|
private boolean |
accountExcluded
Stores whether excluded parts should be accounted in a global monitoring
group or whether they should be ignored and only be accounted for the
entire program.
|
private boolean |
allClassMembers
Returns whether all class members shall be considered for instrumentation
by default or whether SPASS-meter shall apply configuration-based filters
such as "plain time" that may need explicit specification of the
monitoring phase (as arbitrary classes are then not considered for
analysis anymore).
|
private AnnotationSearchType |
annotationSearchType
Stores the annotation search type.
|
private ResourceType[] |
anywayResources
Stores the resources to be collected anyway.
|
private java.lang.String |
baseDir
Stores the base directory.
|
private java.lang.String |
bootJar
Stores the name of the bootpath jar file.
|
private static java.lang.String |
cmdArgs
May carry the initial arguments for initializing an instance of this
class.
|
private boolean |
configurationDetection
Stores if automated configuration detection is enabled.
|
private java.io.PrintStream |
debugLog
Stores the debug log file (lazy initialization).
|
static java.lang.String |
DEFAULT_INSTRUMENTER
Defines the class name of the default instrumenter.
|
private ResourceType[] |
defaultGroupResources
Stores the default resources for monitoring groups(currently all).
|
private java.lang.String |
excludeClasses
Returns whether specific classes shall be excluded.
|
private GroupAccountingType |
groupAccountingType
Stores the group accounting type.
|
static Configuration |
INSTANCE
Stores the instance of this file, i.e. a singleton.
|
private InstanceIdentifierKind |
instanceIdentifierKind
Stores the instance identifier kind.
|
private java.util.Set<java.lang.String> |
instrumented
Stores the names of instrumented classes (preliminary solution).
|
private XMLConfiguration |
instrumenterConfig
Stores the instrumenter configuration taken from XML.
|
private java.lang.String |
instrumenterFactory
Stores the class name of the instrumenter factory.
|
private boolean |
instrumentInstrumenter
Stores if the instrumenter itself should be instrumented (legacy).
|
private boolean |
instrumentJavaLib
Stores whether the java library should be instrumented.
|
private static java.lang.String |
JVM_PROPERTY_CONFIGURATION_ARGS
Defines a key for storing the configuration arguments as JVM property.
|
private ConfigurationListener |
listener
Stores the attached configuration listener.
|
private boolean |
localEventProcessing
If
true, performs asynchronous event processing all the
time, if false use local asynchronous calls as long as
no network-based recorder strategy is running. |
static java.util.logging.Logger |
LOG
Defines the logger.
|
private MainDefaultType |
mainDefault
Stores the default instrumentation behavior at the first main method.
|
private MemoryAccountingType |
memoryAccountingType
Stores the memory accounting type.
|
private boolean |
multiConsiderContained
Stores whether accountable resources of the multi monitoring group
is authoritative or weather the contained groups should be considered.
|
private boolean |
multiDistributeValues
Stores whether values in multi groups should be distributed evenly to
the contained values or whether the entire value should be added to each
group.
|
private java.lang.String |
outFileName
The output file.
|
private int |
outInterval
Stores the interval (in 500ms units) used for incrementally printing
aggregated events.
|
private boolean |
printStatistics
Print statistic output at the end.
|
private boolean |
pruneAnnotations
Stores whether unused annotations should be removed from the resulting
code.
|
private HashMap<java.lang.String,java.lang.String> |
pseudoId
Stores recorderId/pseudoId mappings for multiple recorder ids.
|
private boolean |
recordOverhead
Stores if overhead recording is enabled.
|
private boolean |
registerThreads
Stores whether threads being ready for running should be explicitly
registered with the native implementation (e.g. needed when the Java
implementation does not provide thread-based time monitoring through
JMX).
|
private boolean |
retransformJavaLib
Stores whether the java library classes should be retransformed
and instrumented.
|
private ScopeType |
scopeType
Stores the scope type, i.e. whether and how group annotations determine
the instrumentation.
|
private boolean |
staticInstrumentation
Stores whether the current execution performs static instrumentation.
|
private ResourceType[] |
sumResources
Stores the SUM resources (currently all).
|
private TcpConnectionInfo |
tcp
Stores the hostname for tcp recording.
|
private HashMap<java.lang.String,java.lang.String> |
unrecognizedParams
Stores unrecognized parameters to be passed to plugins.
|
private boolean |
variantContributions
Stores if variant contributions should be collected.
|
| Modifier | Constructor and Description |
|---|---|
private |
Configuration()
Prevents this class from being instantiated from outside.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
accountExcluded()
Returns whether excluded parts should be accounted in a global monitoring
group or whether they should be ignored and only be accounted for the
entire program.
|
boolean |
accountForGlobalResource(boolean sum,
ResourceType resource)
Returns whether we shall account for a global SUM/System resource.
|
boolean |
allClassMembers()
Returns whether all class members should be analyzed for instrumentation
by default or whether SPASS-meter shall apply filter strategies such as
"plain time".
|
void |
attachListener(ConfigurationListener listener)
Allows to set once a configuration listener (internal use only).
|
void |
close()
Closes the configuration (end of recording).
|
private void |
closeDebugLog()
Closes the debug log.
|
boolean |
configurationDetection()
Returns whether automatic configuration detection should be performed.
|
void |
debugLog(java.lang.String text)
Provides the opportunity to log to a debug file (if specified
in configuration).
|
private void |
ensureDefaultResources()
Ensures that the
defaultGroupResources is a subset of
accountableResources. |
ResourceType[] |
getAccountableResources()
Returns the resources which are accountable at all.
|
AnnotationSearchType |
getAnnotationSearchType()
Returns how annotations in super classes and interfacecs should be taken
into account.
|
ResourceType[] |
getAnywayResources()
Returns the resources to be accounted anyway.
|
java.lang.String |
getBaseDir()
Returns the base directory.
|
java.lang.String |
getBootJar()
Returns the name of the bootpath jar file .
|
ResourceType[] |
getDefaultGroupResources()
Returns the default resources for monitoring groups.
|
java.lang.String[] |
getExcludeClasses()
Returns class name prefixes to be excluded (given in / rather
than . notation).
|
GroupAccountingType |
getGroupAccountingType()
Returns the group accounting type [startup only].
|
InstanceIdentifierKind |
getInstanceIdentifierKind()
Returns the default instance identifier kind.
|
java.lang.String |
getInstrumenterFactory()
Returns the instrumenter factory class name.
|
MainDefaultType |
getMainDefault()
Returns the default instrumentation behavior for the first main
method considered by the instrumenter.
|
MemoryAccountingType |
getMemoryAccountingType()
Returns the memory accounting type [startup only].
|
MonitoringGroupConfiguration |
getMonitoringGroupConfiguration(java.lang.String recId)
Returns the monitoring group configuration assigned to
recId. |
java.io.File |
getOutFile()
Returns the output file.
|
java.lang.String |
getOutFileName()
Returns the name of the output file.
|
int |
getOutInterval()
Returns the interval used for incrementally printing
aggregated events.
|
java.lang.String |
getPseudoMapping(java.lang.String recId)
Returns the ids mapped to the given pseudo id.
|
java.lang.String |
getRecId(java.lang.String[] id)
Returns the first id if there is only one in the array or the (previously
generated) pseudo id.
|
RecordingType |
getRecordingType()
Returns whether local event processing shall be done or whether
local synchronous calls shall be used instead.
|
ScopeType |
getScopeType()
Returns the scope type, i.e. the influence of the monitoring group on
the actual instrumentation.
|
ResourceType[] |
getSumResources()
Returns the resources to be accounted for the SUM (system under
monitoring).
|
java.lang.String |
getTCPHostname()
Returns the hostname.
|
int |
getTCPPort()
Returns the port.
|
java.lang.String |
getUnrecognizedParam(java.lang.String key)
Returns an (unmodifiable) map of unrecognized params detected during
parsing the agent options.
|
XMLConfiguration |
getXMLConfig()
Returns the XML configuration.
|
void |
instrumented(java.lang.String name)
Marks a class as instrumented.
|
boolean |
instrumentInstrumenter()
Returns if the instrumenter should be instrumented (legacy).
|
boolean |
instrumentJavaLib()
Returns whether the java library should be instrumented.
|
boolean |
isInstrumented(java.lang.String name)
Returns whether a class was instrumented.
|
boolean |
isStaticInstrumentation()
Returns whether the current execution performs a static instrumentation.
|
boolean |
measureVariantContributions()
Returns whether individual contributions of variants to configurations
should be measured.
|
boolean |
multiGroupsConsiderContained()
Returns whether accountable resources of the multi monitoring group
is authoritative or weather the contained groups should be considered.
|
boolean |
multiGroupsDistributeValues()
Returns whether values in multi groups should be distributed evenly to
the contained values or whether the entire value should be added to each
group.
|
boolean |
printStatistics()
Returns whether statistics shall be printed at the end of monitoring.
|
boolean |
programUseFromJvm()
Returns whether the memory used by the program should be inferred from
JVM information or by accounting this information individually (memory
intensive).
|
boolean |
pruneAnnotations()
Returns whether java library classes should be retransformed and
instrumented at program start (additional overhead).
|
void |
read(java.io.DataInputStream in)
Reads this instance from the given input stream.
|
void |
readFromAgentArguments(java.lang.String args)
Reads the configuration parameters from an agent command line.
|
boolean |
recordOverhead()
Returns if measurement overhead should be collected.
|
boolean |
registerThreads()
Returns whether threads being ready for running should be explicitly
registered with the native implementation (e.g. needed when the Java
implementation does not provide thread-based time monitoring through
JMX).
|
boolean |
retransformJavaLib()
Returns whether java library classes should be retransformed and
instrumented at program start (additional overhead).
|
void |
setBaseDir(java.lang.String baseDir)
Changes the (optional) base directory (to be prepended to file location
specifications).
|
void |
setBootJar(java.lang.String bootJar)
Changes the name of the bootpath jar file.
|
void |
setDebugLog(java.lang.String debugLog)
Changes the debug log file.
|
void |
setLogLevel(java.lang.String level)
Changes the logging level.
|
void |
setOutFileName(java.lang.String outFile)
Changes the name of the output file.
|
void |
setOutInterval(int outInterval)
Changes the interval used for incrementally printing
aggregated events.
|
void |
setStaticInstrumentation(boolean staticInstrumentation)
Changes whether the current execution performs a static instrumentation.
|
void |
setTCPData(java.lang.String hostname,
int port)
Changes TPC settings.
|
void |
setXMLConfig(java.lang.String xmlConfig)
Parses the specified XML configuration.
|
void |
write(java.io.DataOutputStream out)
Writes this instance to the given output stream.
|
public static final java.lang.String DEFAULT_INSTRUMENTER
public static final java.util.logging.Logger LOG
public static final Configuration INSTANCE
private static final java.lang.String JVM_PROPERTY_CONFIGURATION_ARGS
private static java.lang.String cmdArgs
private java.lang.String outFileName
private int outInterval
This value must be > 0, otherwise this function will be disabled.
private boolean printStatistics
private java.lang.String baseDir
private boolean instrumentInstrumenter
private boolean recordOverhead
false.private boolean configurationDetection
private boolean variantContributions
private java.lang.String instrumenterFactory
private HashMap<java.lang.String,java.lang.String> unrecognizedParams
private TcpConnectionInfo tcp
private boolean localEventProcessing
true, performs asynchronous event processing all the
time, if false use local asynchronous calls as long as
no network-based recorder strategy is running.private java.lang.String bootJar
private java.io.PrintStream debugLog
private XMLConfiguration instrumenterConfig
private boolean instrumentJavaLib
private boolean retransformJavaLib
private boolean pruneAnnotations
private ScopeType scopeType
ScopeType.SUM due to
legacy reasons.private boolean staticInstrumentation
private MemoryAccountingType memoryAccountingType
private GroupAccountingType groupAccountingType
private InstanceIdentifierKind instanceIdentifierKind
private AnnotationSearchType annotationSearchType
private ResourceType[] accountableResources
private ResourceType[] defaultGroupResources
private ResourceType[] sumResources
private ResourceType[] anywayResources
private boolean multiDistributeValues
private boolean multiConsiderContained
private MainDefaultType mainDefault
private boolean registerThreads
private ConfigurationListener listener
private java.util.Set<java.lang.String> instrumented
private HashMap<java.lang.String,java.lang.String> pseudoId
private boolean accountExcluded
private boolean allClassMembers
private java.lang.String excludeClasses
private Configuration()
public void write(java.io.DataOutputStream out)
throws java.io.IOException
out - the output streamjava.io.IOException - in case of any I/O error or problempublic void read(java.io.DataInputStream in)
throws java.io.IOException
in - the input streamjava.io.IOException - in case of any I/O error or problempublic void attachListener(ConfigurationListener listener)
listener - the configuration listenerpublic boolean instrumentInstrumenter()
true if enabled, false elsepublic MemoryAccountingType getMemoryAccountingType()
public GroupAccountingType getGroupAccountingType()
public InstanceIdentifierKind getInstanceIdentifierKind()
public void setLogLevel(java.lang.String level)
level - the new logging levelLevelpublic void setBaseDir(java.lang.String baseDir)
baseDir - the base directory, may be null if unusedpublic java.lang.String getBaseDir()
public void setOutFileName(java.lang.String outFile)
outFile - the name of the output filepublic java.lang.String getOutFileName()
public void setBootJar(java.lang.String bootJar)
bootJar - the name of the bootpath jar filepublic void setDebugLog(java.lang.String debugLog)
debugLog - the new debug log fileprivate void closeDebugLog()
public void close()
public void setXMLConfig(java.lang.String xmlConfig)
xmlConfig - the XML configuration filepublic XMLConfiguration getXMLConfig()
public java.lang.String getBootJar()
public java.io.File getOutFile()
baseDirpublic boolean printStatistics()
true if statistics shall be printed,
false elsepublic int getOutInterval()
public void setOutInterval(int outInterval)
outInterval - the output interval, disables event printing if
negativepublic ResourceType[] getAccountableResources()
public ResourceType[] getDefaultGroupResources()
getAccountableResources()public ResourceType[] getSumResources()
getAccountableResources()public ResourceType[] getAnywayResources()
getAccountableResources()
and ResourceType.SET_ANYWAY.public boolean accountForGlobalResource(boolean sum,
ResourceType resource)
sum - true for an answer for SUM-level, false for system levelresource - the resource to query fortrue for accounting, false elsepublic boolean instrumentJavaLib()
true if the java library should be instrumented,
false elsepublic boolean retransformJavaLib()
true if the java library should be retransformed,
false elsepublic boolean pruneAnnotations()
true if unused annotations should
be removed from the resulting code, false elsepublic boolean isStaticInstrumentation()
true if currently a static instrumentation is
performed, false elsepublic void setStaticInstrumentation(boolean staticInstrumentation)
staticInstrumentation - true if currently a static
instrumentation is performed, false elsepublic boolean recordOverhead()
true if measurement overhead should be
collected, false elsepublic boolean configurationDetection()
true if configuration detection should be
performed, false elsepublic boolean measureVariantContributions()
true if configuration detection should be
performed, false elsepublic void setTCPData(java.lang.String hostname,
int port)
hostname - the hostname of the TCP recording serverport - the port number of the TCP recording serverpublic java.lang.String getTCPHostname()
public int getTCPPort()
public void readFromAgentArguments(java.lang.String args)
args - the agent command lineprivate void ensureDefaultResources()
defaultGroupResources is a subset of
accountableResources. Adjusts memoryAccountingType
and defaultGroupResources, sumResources as well as
anywayResources accordingly.public ScopeType getScopeType()
public java.lang.String getUnrecognizedParam(java.lang.String key)
key - the configuration parameter namepublic final void debugLog(java.lang.String text)
text - the text to logpublic MonitoringGroupConfiguration getMonitoringGroupConfiguration(java.lang.String recId)
recId.recId - the recording id to considerpublic void instrumented(java.lang.String name)
name - the name of the classpublic boolean isInstrumented(java.lang.String name)
name - the name of the classtrue if it was instrumented, false elsepublic boolean programUseFromJvm()
true the information should be inferred from the
JVM, false individual accounting should be performedpublic AnnotationSearchType getAnnotationSearchType()
public java.lang.String getRecId(java.lang.String[] id)
id - the ids to return the unique id forpublic java.lang.String getPseudoMapping(java.lang.String recId)
recId - a pseudo recording idpublic boolean multiGroupsDistributeValues()
true if values should be distributed,
false if notpublic boolean multiGroupsConsiderContained()
true if the contained groups values should be
considered, false if the multi group is authoritativepublic MainDefaultType getMainDefault()
public boolean registerThreads()
true if threads need to be registered explicitly,
false elsepublic boolean accountExcluded()
true if they should be accounted in an own
monitoring group, false if only for the entire programpublic java.lang.String[] getExcludeClasses()
public java.lang.String getInstrumenterFactory()
public RecordingType getRecordingType()
true in case of local asynchronous event processing,
false elsepublic boolean allClassMembers()
true if all class members shall be analyzed by
default, false if filters shall be applied