public class StringEventCounterData extends ManagedCounterData implements Reportable
ManagedCounterData.Counter
Modifier and Type | Field and Description |
---|---|
(package private) String |
dataName
A string description of this data;
|
(package private) static boolean |
DEBUG |
(package private) int |
eventNumber
Used to keep track of how many counters have been used so far.
|
protected Hashtable<String,Integer> |
stringToCounterMap
Map strings to a counter location
|
automaticallyGrowCounters, counterManager, handle, numCounters
Constructor and Description |
---|
StringEventCounterData(InstrumentedEventCounterManager manager,
String name) |
Modifier and Type | Method and Description |
---|---|
protected static String |
doubleToString(double num)
Converts a double to string with maximum precision.
|
int |
getCounterIndexForString(String str)
For a given string, return the number of the counter associated
with this string.
|
Instruction |
getCounterInstructionForEvent(String event)
Given a string, find or create the counter associated and return
and instruction to increment that counter.
|
Instruction |
getCounterInstructionForEvent(String event,
double incrementValue)
Given a string, find or create the counter associated and return
and instruction to increment that counter.
|
int |
getOrCreateCounterIndexForString(String str)
For a given string, return the number of the counter associated
with this string.
|
void |
report()
Print a report at the end of execution
|
void |
reset()
reset (clear) data set being gathered
|
automaticallyGrowCounters, createEventCounterInstruction, createEventCounterInstruction, getCounter, getCounterManager, getHandle, getNumCounters, initializeCounters, report, resizeCounters, setCounter
static final boolean DEBUG
protected final Hashtable<String,Integer> stringToCounterMap
int eventNumber
StringEventCounterData(InstrumentedEventCounterManager manager, String name)
manager
- The manager that will provide the counter spacename
- human-readable name for the datapublic Instruction getCounterInstructionForEvent(String event)
event
- The name of the eventpublic Instruction getCounterInstructionForEvent(String event, double incrementValue)
event
- The name of the eventincrementValue
- The value to add to counterprotected static String doubleToString(double num)
num
- double to convertpublic void report()
report
in interface Reportable
public int getOrCreateCounterIndexForString(String str)
str
- The string for which you want the counter numberpublic int getCounterIndexForString(String str)
str
- The string for which you want the counter numberpublic void reset()
Reportable
reset
in interface Reportable