Public Member Functions | |
CCNEnumStats (IStatsEnum stats) | |
void | clearCounters () |
Reset all counters to zero. | |
boolean | isAveragingCounter (String name) throws IllegalArgumentException |
Is the counter an averaging counter? This will only function correctly after the system is run for a while and we see if it is called with increment or addsample. | |
long | getCounter (String name) throws IllegalArgumentException |
Return the value of a counter. | |
double[] | getAverageAndStdev (String name) throws IllegalArgumentException |
Return the average and standard deviation 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) |
void | addSample (K key, long value) |
Add a sample to the averaging counter for the key. | |
Protected Attributes | |
final AtomicLong[] | _counters |
final IStatsEnum | _resolver |
boolean | _enabled = true |
final AveragingCounter[] | _avgcounters |
Classes | |
class | AveragingCounter |
This is used to track an averaging counter. | |
interface | IStatsEnum |
The statistics Enum used by "K extends Enum<K>" must implement this interface. More... |
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.
double [] org.ccnx.ccn.impl.CCNStats.CCNEnumStats< K extends Enum< K >>.getAverageAndStdev | ( | String | name | ) | throws IllegalArgumentException [virtual] |
Return the average and standard deviation of a counter.
You need to have been accumulating samples with the addSample(item, value) method.
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.
void org.ccnx.ccn.impl.CCNStats.CCNEnumStats< K extends Enum< K >>.addSample | ( | K | key, | |
long | value | |||
) |
Add a sample to the averaging counter for the key.
This make the key an averaging counter as reported by toString().