NFVBENCH-194 Fix too many headers in NFVBenchSummarizer using server mode 85/71485/1
authorfmenguy <francoisregis.menguy@orange.com>
Tue, 24 Nov 2020 13:00:25 +0000 (14:00 +0100)
committerfmenguy <francoisregis.menguy@orange.com>
Tue, 24 Nov 2020 14:06:16 +0000 (15:06 +0100)
Change-Id: I5c2394bc87c845caa2b322c30ed9dbf4feb20e86
Signed-off-by: fmenguy <francoisregis.menguy@orange.com>
nfvbench/summarizer.py

index 0759933..1da3ee2 100644 (file)
@@ -219,35 +219,6 @@ class Summarizer(object):
 class NFVBenchSummarizer(Summarizer):
     """Summarize nfvbench json result."""
 
-    ndr_pdr_header = [
-        ('-', Formatter.fixed),
-        ('L2 Frame Size', Formatter.standard),
-        ('Rate (fwd+rev)', Formatter.bits),
-        ('Rate (fwd+rev)', Formatter.suffix(' pps')),
-        ('Avg Drop Rate', Formatter.suffix('%')),
-        ('Avg Latency (usec)', Formatter.standard),
-        ('Min Latency (usec)', Formatter.standard),
-        ('Max Latency (usec)', Formatter.standard)
-    ]
-
-    single_run_header = [
-        ('L2 Frame Size', Formatter.standard),
-        ('Drop Rate', Formatter.suffix('%')),
-        ('Avg Latency (usec)', Formatter.standard),
-        ('Min Latency (usec)', Formatter.standard),
-        ('Max Latency (usec)', Formatter.standard)
-    ]
-
-    config_header = [
-        ('Direction', Formatter.standard),
-        ('Requested TX Rate (bps)', Formatter.bits),
-        ('Actual TX Rate (bps)', Formatter.bits),
-        ('RX Rate (bps)', Formatter.bits),
-        ('Requested TX Rate (pps)', Formatter.suffix(' pps')),
-        ('Actual TX Rate (pps)', Formatter.suffix(' pps')),
-        ('RX Rate (pps)', Formatter.suffix(' pps'))
-    ]
-
     direction_keys = ['direction-forward', 'direction-reverse', 'direction-total']
     direction_names = ['Forward', 'Reverse', 'Total']
 
@@ -260,6 +231,35 @@ class NFVBenchSummarizer(Summarizer):
         self.record_data = None
         self.sender = sender
 
+        self.ndr_pdr_header = [
+            ('-', Formatter.fixed),
+            ('L2 Frame Size', Formatter.standard),
+            ('Rate (fwd+rev)', Formatter.bits),
+            ('Rate (fwd+rev)', Formatter.suffix(' pps')),
+            ('Avg Drop Rate', Formatter.suffix('%')),
+            ('Avg Latency (usec)', Formatter.standard),
+            ('Min Latency (usec)', Formatter.standard),
+            ('Max Latency (usec)', Formatter.standard)
+        ]
+
+        self.single_run_header = [
+            ('L2 Frame Size', Formatter.standard),
+            ('Drop Rate', Formatter.suffix('%')),
+            ('Avg Latency (usec)', Formatter.standard),
+            ('Min Latency (usec)', Formatter.standard),
+            ('Max Latency (usec)', Formatter.standard)
+        ]
+
+        self.config_header = [
+            ('Direction', Formatter.standard),
+            ('Requested TX Rate (bps)', Formatter.bits),
+            ('Actual TX Rate (bps)', Formatter.bits),
+            ('RX Rate (bps)', Formatter.bits),
+            ('Requested TX Rate (pps)', Formatter.suffix(' pps')),
+            ('Actual TX Rate (pps)', Formatter.suffix(' pps')),
+            ('RX Rate (pps)', Formatter.suffix(' pps'))
+        ]
+
         # add percentiles headers if hdrh enabled
         if not self.config.disable_hdrh:
             for percentile in self.config.lat_percentiles: