org.eclipse.ocl.examples.eventmanager.util
Class Statistics
java.lang.Object
org.eclipse.ocl.examples.eventmanager.util.Statistics
- Direct Known Subclasses:
- StatisticsImpl, StatisticsStub
public abstract class Statistics
- extends java.lang.Object
To gather statistics about the OCL Impact Analysis and EMF Event Manager, set the system property
org.eclipse.ocl.examples.impactanalyzer.statistics to true. Otherwise, calls to
getInstance()
will return a mock object whose methods don't do anything and therefore should not contribute
significantly to overall performance characteristics. If the system property is set, however, statistics will be
gathered and can obtained at the end of a test / measurement run by using methods on the result of
getInstance()
such as getAverage(String)
passing in any of the groupId
s
returned by getGroupIds()
. All individual records of a group can be obtained by getRecords(String)
.
Method Summary |
java.lang.String |
asCSV()
|
java.util.Map<java.lang.String,java.lang.String> |
asCSVMapByGroupId()
Keys are the group IDs, values are the CSV lists for the group whose ID is the entry's key |
java.lang.String |
asSV(java.lang.String columnSeparator)
|
java.util.Map<java.lang.String,java.lang.String> |
asSVMapByGroupId(java.lang.String columnSeparator)
|
java.lang.String |
averageAsCVS()
|
java.lang.String |
averageAsSV(java.lang.String columnSeparator)
|
abstract void |
begin(java.lang.String groupId,
java.lang.Object key)
Starts measuring a time span until end(String, Object) is called with equal groupId
and key . |
abstract void |
clear()
|
abstract void |
end(java.lang.String groupId,
java.lang.Object key)
|
double |
getAverage(java.lang.String groupId)
|
abstract java.util.Set<java.lang.String> |
getGroupIds()
|
static Statistics |
getInstance()
|
abstract java.util.List<Statistics.Record> |
getRecords(java.lang.String groupId)
|
abstract void |
record(java.lang.String groupId,
java.lang.Object key,
long value)
Records a single value (could be a time measured other than with begin(String, Object) and
end(String, Object) , but could also be any other quantity over which later aggregation may
be performed. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Statistics
public Statistics()
getInstance
public static Statistics getInstance()
begin
public abstract void begin(java.lang.String groupId,
java.lang.Object key)
- Starts measuring a time span until
end(String, Object)
is called with equal groupId
and key
. Averages can be computed later for different keys with equal groupId
.
end
public abstract void end(java.lang.String groupId,
java.lang.Object key)
record
public abstract void record(java.lang.String groupId,
java.lang.Object key,
long value)
- Records a single value (could be a time measured other than with
begin(String, Object)
and
end(String, Object)
, but could also be any other quantity over which later aggregation may
be performed.
getRecords
public abstract java.util.List<Statistics.Record> getRecords(java.lang.String groupId)
getGroupIds
public abstract java.util.Set<java.lang.String> getGroupIds()
clear
public abstract void clear()
getAverage
public double getAverage(java.lang.String groupId)
averageAsSV
public java.lang.String averageAsSV(java.lang.String columnSeparator)
averageAsCVS
public java.lang.String averageAsCVS()
asCSVMapByGroupId
public java.util.Map<java.lang.String,java.lang.String> asCSVMapByGroupId()
- Keys are the group IDs, values are the CSV lists for the group whose ID is the entry's key
asSVMapByGroupId
public java.util.Map<java.lang.String,java.lang.String> asSVMapByGroupId(java.lang.String columnSeparator)
asSV
public java.lang.String asSV(java.lang.String columnSeparator)
asCSV
public java.lang.String asCSV()