This is a helper class for implementing statistics. More...
Classes | |
interface | IStatsEnum |
The statistics Enum used by "K extends Enum<K>" must implement this interface. More... | |
Public Member Functions | |
CCNEnumStats (IStatsEnum stats) | |
void | clearCounters () |
Reset all counters to zero. | |
long | getCounter (String name) throws IllegalArgumentException |
Return the value of a counter. | |
String[] | getCounterNames () |
Return a list of statistic counter names, in the preferred display order. | |
String | getCounterUnits (String name) throws IllegalArgumentException |
Return a text description of the units of the counter (e.g. | |
void | setEnabled (boolean enabled) |
If enabled, gather stats, otherwise do not. | |
String | toString () |
Dump the counters in the preferred format to a String for display. | |
void | increment (K key) |
void | increment (K key, int value) |
Protected Attributes | |
final AtomicLong[] | _counters |
final IStatsEnum | _resolver |
boolean | _enabled = true |
This is a helper class for implementing statistics.
long org.ccnx.ccn.impl.CCNStats.CCNEnumStats< K extends Enum< K > >.getCounter | ( | String | name | ) | throws IllegalArgumentException [virtual] |
Return the value of a counter.
name |
IllegalArgumentException | if name unrecognized |
Implements org.ccnx.ccn.impl.CCNStats.
String [] org.ccnx.ccn.impl.CCNStats.CCNEnumStats< K extends Enum< K > >.getCounterNames | ( | ) | [virtual] |
Return a list of statistic counter names, in the preferred display order.
Implements org.ccnx.ccn.impl.CCNStats.
String org.ccnx.ccn.impl.CCNStats.CCNEnumStats< K extends Enum< K > >.getCounterUnits | ( | String | name | ) | throws IllegalArgumentException [virtual] |
Return a text description of the units of the counter (e.g.
packets, packets per second)
name |
IllegalArgumentException | if name unrecognized |
Implements org.ccnx.ccn.impl.CCNStats.
void org.ccnx.ccn.impl.CCNStats.CCNEnumStats< K extends Enum< K > >.setEnabled | ( | boolean | enabled | ) | [virtual] |
If enabled, gather stats, otherwise do not.
enabled |
Implements org.ccnx.ccn.impl.CCNStats.