NB API for packet count statistics. analytics.py demonstrates how to use it.
[affinity.git] / analytics / northbound / src / main / java / org / opendaylight / affinity / analytics / northbound / AllStatistics.java
index 964e3df3943a6000d1912e5b7ada971b6a8dddcd..87037f1206a7d30825081beb0948df42ba24e7c8 100644 (file)
@@ -28,12 +28,14 @@ public class AllStatistics {
     private AllStatistics() {
     }
 
-    public AllStatistics(Map<Byte, Long> byteCounts, Map<Byte, Double> bitRates) {
+    public AllStatistics(Map<Byte, Long> byteCounts, Map<Byte, Long> packetCounts, Map<Byte, Double> durations, Map<Byte, Double> bitRates) {
         this.stats = new ArrayList<ProtocolStatistics>();
         for (Byte protocol : byteCounts.keySet()) {
             long byteCount = byteCounts.get(protocol);
+            long packetCount = packetCounts.get(protocol);
+            double duration = durations.get(protocol);
             double bitRate = bitRates.get(protocol);
-            this.stats.add(new ProtocolStatistics(protocol, new Statistics(byteCount, bitRate)));
+            this.stats.add(new ProtocolStatistics(protocol, new Statistics(byteCount, packetCount, duration, bitRate)));
         }
     }