Ignore PORT_STATS_UPDATED from topology metrics
Change-Id: I40d796c668700fdb0bf220eb02f2001deb77a4c2
diff --git a/apps/metrics/src/main/java/org/onosproject/metrics/topology/TopologyMetrics.java b/apps/metrics/src/main/java/org/onosproject/metrics/topology/TopologyMetrics.java
index 8f6674f..5785f5f 100644
--- a/apps/metrics/src/main/java/org/onosproject/metrics/topology/TopologyMetrics.java
+++ b/apps/metrics/src/main/java/org/onosproject/metrics/topology/TopologyMetrics.java
@@ -193,9 +193,15 @@
private class InnerDeviceListener implements DeviceListener {
@Override
public void event(DeviceEvent event) {
- recordEvent(event, topologyDeviceEventMetric);
- log.debug("Device Event: time = {} type = {} event = {}",
+ // Ignore PORT_STATS_UPDATED probe event from interfering with
+ // other device event timestamps
+ if (event.type() == DeviceEvent.Type.PORT_STATS_UPDATED) {
+ log.info("PORT_STATS_UPDATED event ignored from metrics");
+ } else {
+ recordEvent(event, topologyDeviceEventMetric);
+ log.info("Device Event: time = {} type = {} event = {}",
event.time(), event.type(), event);
+ }
}
}