import java.util.Timer;
import java.util.TimerTask;
import java.util.concurrent.ConcurrentHashMap;
-
import org.opendaylight.openflowjava.protocol.spi.statistics.StatisticsHandler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
*/
public static final int MINIMAL_LOG_REPORT_PERIOD = 500;
private static StatisticsCounters instanceHolder;
- private static final Logger LOGGER = LoggerFactory.getLogger(StatisticsCounters.class);
+ private static final Logger LOG = LoggerFactory.getLogger(StatisticsCounters.class);
private Timer logReporter;
private int logReportPeriod;
CounterEventTypes.DS_ENTERED_OFJAVA,
CounterEventTypes.DS_FLOW_MODS_ENTERED,
CounterEventTypes.DS_FLOW_MODS_SENT,
+ CounterEventTypes.US_DROPPED_PACKET_IN,
CounterEventTypes.US_DECODE_FAIL,
CounterEventTypes.US_DECODE_SUCCESS,
CounterEventTypes.US_MESSAGE_PASS,
runCounting = false;
this.logReportPeriod = 0;
this.runLogReport = false;
- LOGGER.debug("StaticsCounters has been created");
+ LOG.debug("StaticsCounters has been created");
}
/**
return;
}
resetCounters();
- LOGGER.debug("Counting started...");
+ LOG.debug("Counting started...");
if(reportToLogs){
startLogReport(logReportDelay);
}
*/
public void stopCounting(){
runCounting = false;
- LOGGER.debug("Stop counting...");
+ LOG.debug("Stop counting...");
stopLogReport();
}
logReporter = new Timer("SC_Timer");
logReporter.schedule(new LogReporterTask(this), this.logReportPeriod, this.logReportPeriod);
runLogReport = true;
- LOGGER.debug("Statistics log reporter has been scheduled with period {} ms", this.logReportPeriod);
+ LOG.debug("Statistics log reporter has been scheduled with period {} ms", this.logReportPeriod);
}
/**
if(runLogReport){
if(logReporter != null){
logReporter.cancel();
- LOGGER.debug("Statistics log reporter has been canceled");
+ LOG.debug("Statistics log reporter has been canceled");
}
runLogReport = false;
}
/**
* Get counter by CounterEventType
* @param counterEventKey key to identify counter (can not be null)
- * @return - Counter object or null if counter has not been enabled
- * @exception - IllegalArgumentException if counterEventKey is null
+ * @return Counter object or null if counter has not been enabled
+ * @throws IllegalArgumentException if counterEventKey is null
*/
public Counter getCounter(CounterEventTypes counterEventKey) {
if (counterEventKey == null) {
for(CounterEventTypes cet : enabledCounters){
countersMap.get(cet).reset();
}
- LOGGER.debug("StaticsCounters has been reset");
+ LOG.debug("StaticsCounters has been reset");
}
@Override
@Override
public void run() {
for(CounterEventTypes cet : sc.getEnabledCounters()){
- LOG.debug(cet.name() + ": " + sc.getCountersMap().get(cet).getStat());
+ LOG.debug("{}: {}", cet.name(), sc.getCountersMap().get(cet).getStat());
}
}
}
-}
\ No newline at end of file
+}