public final class OcpStatisticsCounters extends Object implements org.opendaylight.ocpjava.protocol.spi.statistics.OcpStatisticsHandler
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_LOG_REPORT_PERIOD
Default delay between two writings into log (milliseconds)
|
static int |
MINIMAL_LOG_REPORT_PERIOD
Minimal delay between two writings into log (milliseconds)
|
| Modifier and Type | Method and Description |
|---|---|
Counter |
getCounter(CounterEventTypes counterEventKey)
Get counter by CounterEventType
|
protected Map<CounterEventTypes,Counter> |
getCountersMap() |
protected CounterEventTypes[] |
getEnabledCounters() |
static OcpStatisticsCounters |
getInstance()
Get instance of statistics counters, first created object does not start counting and log reporting
|
int |
getLogReportPeriod() |
void |
incrementCounter(CounterEventTypes counterEventKey)
Increment value of given counter
|
boolean |
isCounterEnabled(CounterEventTypes counterEventKey)
Give an information if is given counter is enabled
|
boolean |
isRunCounting()
Give an information if counting is running
|
boolean |
isRunLogReport()
Give an information if log reporter is running (statistics are write into logs).
|
String |
printOcpStatistics() |
void |
resetCounters() |
void |
startCounting(boolean reportToLogs,
int logReportDelay)
Start counting (counters are set to 0 before counting starts)
|
void |
startLogReport(int logReportDelay)
Prints statistics with given delay between logs
|
void |
stopCounting()
Stop counting, values in counters are untouched, log reporter is stopped
|
void |
stopLogReport()
Stops logging, counting continues
|
public static final int DEFAULT_LOG_REPORT_PERIOD
public static final int MINIMAL_LOG_REPORT_PERIOD
public static OcpStatisticsCounters getInstance()
public void startCounting(boolean reportToLogs,
int logReportDelay)
reportToLogs - - true = statistic counters will periodically loglogReportDelay - - delay between two logs (in milliseconds)public void stopCounting()
public boolean isRunCounting()
public void startLogReport(int logReportDelay)
logReportDelay - - delay between two logs (in milliseconds)IllegalArgumentException - if logReportDelay is less than 0public void stopLogReport()
public boolean isRunLogReport()
public int getLogReportPeriod()
protected CounterEventTypes[] getEnabledCounters()
protected Map<CounterEventTypes,Counter> getCountersMap()
public boolean isCounterEnabled(CounterEventTypes counterEventKey)
counterEventKey - public Counter getCounter(CounterEventTypes counterEventKey)
counterEventKey - key to identify counter (can not be null)IllegalArgumentException - if counterEventKey is nullpublic void incrementCounter(CounterEventTypes counterEventKey)
counterEventKey - key to identify counterpublic void resetCounters()
resetCounters in interface org.opendaylight.ocpjava.protocol.spi.statistics.OcpStatisticsHandlerpublic String printOcpStatistics()
printOcpStatistics in interface org.opendaylight.ocpjava.protocol.spi.statistics.OcpStatisticsHandlerCopyright © 2016 OpenDaylight. All Rights Reserved.