PAL: Add hoststack and vsap to comp tables
[csit.git] / resources / tools / presentation / generator_tables.py
index 0b063b1..fd33983 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2021 Cisco and/or its affiliates.
+# Copyright (c) 2022 Cisco and/or its affiliates.
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at:
@@ -297,28 +297,15 @@ def table_oper_data_html(table, input_data):
             threads = dict({idx: list() for idx in range(len(runtime))})
             for idx, run_data in runtime.items():
                 for gnode, gdata in run_data.items():
-                    if gdata[u"vectors"] > 0:
-                        clocks = gdata[u"clocks"] / gdata[u"vectors"]
-                    elif gdata[u"calls"] > 0:
-                        clocks = gdata[u"clocks"] / gdata[u"calls"]
-                    elif gdata[u"suspends"] > 0:
-                        clocks = gdata[u"clocks"] / gdata[u"suspends"]
-                    else:
-                        clocks = 0.0
-                    if gdata[u"calls"] > 0:
-                        vectors_call = gdata[u"vectors"] / gdata[u"calls"]
-                    else:
-                        vectors_call = 0.0
-                    if int(gdata[u"calls"]) + int(gdata[u"vectors"]) + \
-                            int(gdata[u"suspends"]):
-                        threads[idx].append([
-                            gnode,
-                            int(gdata[u"calls"]),
-                            int(gdata[u"vectors"]),
-                            int(gdata[u"suspends"]),
-                            clocks,
-                            vectors_call
-                        ])
+                    threads[idx].append([
+                        gnode,
+                        int(gdata[u"calls"]),
+                        int(gdata[u"vectors"]),
+                        int(gdata[u"suspends"]),
+                        float(gdata[u"clocks"]),
+                        float(gdata[u"vectors"] / gdata[u"calls"]) \
+                            if gdata[u"calls"] else 0.0
+                    ])
 
             bold = ET.SubElement(tcol, u"b")
             bold.text = (
@@ -576,6 +563,22 @@ def _tpc_insert_data(target, src, include_tests):
                 target[u"data"].append(
                     float(u"nan") if lat == -1 else lat * 1e6
                 )
+        elif include_tests == u"hoststack":
+            try:
+                target[u"data"].append(
+                    float(src[u"result"][u"bits_per_second"])
+                )
+            except KeyError:
+                target[u"data"].append(
+                    (float(src[u"result"][u"client"][u"tx_data"]) * 8) /
+                    ((float(src[u"result"][u"client"][u"time"]) +
+                      float(src[u"result"][u"server"][u"time"])) / 2)
+                )
+        elif include_tests == u"vsap":
+            try:
+                target[u"data"].append(src[u"result"][u"cps"])
+            except KeyError:
+                target[u"data"].append(src[u"result"][u"rps"])
     except (KeyError, TypeError):
         pass
 
@@ -972,8 +975,8 @@ def table_perf_trending_dash(table, input_data):
     header = [
         u"Test Case",
         u"Trend [Mpps]",
-        u"Number of runs [#]",
-        u"Trend Change [%]",
+        u"Runs [#]",
+        u"Long-Term Change [%]",
         u"Regressions [#]",
         u"Progressions [#]"
     ]
@@ -1148,17 +1151,20 @@ def _generate_url(testbed, test_name):
     elif u"2t1c" in test_name or \
          (u"-1c-" in test_name and
           testbed in
-          (u"2n-skx", u"3n-skx", u"2n-clx", u"2n-zn2", u"2n-aws", u"3n-aws")):
+          (u"2n-icx", u"3n-icx", u"2n-skx", u"3n-skx", u"2n-clx", u"2n-zn2",
+           u"2n-aws", u"3n-aws")):
         cores = u"2t1c"
     elif u"4t2c" in test_name or \
          (u"-2c-" in test_name and
           testbed in
-          (u"2n-skx", u"3n-skx", u"2n-clx", u"2n-zn2", u"2n-aws", u"3n-aws")):
+          (u"2n-icx", u"3n-icx", u"2n-skx", u"3n-skx", u"2n-clx", u"2n-zn2",
+           u"2n-aws", u"3n-aws")):
         cores = u"4t2c"
     elif u"8t4c" in test_name or \
          (u"-4c-" in test_name and
           testbed in
-          (u"2n-skx", u"3n-skx", u"2n-clx", u"2n-zn2", u"2n-aws", u"3n-aws")):
+          (u"2n-icx", u"3n-icx", u"2n-skx", u"3n-skx", u"2n-clx", u"2n-zn2",
+           u"2n-aws", u"3n-aws")):
         cores = u"8t4c"
     else:
         cores = u""
@@ -1825,8 +1831,8 @@ def table_comparison(table, input_data):
                             include_tests=table[u"include-tests"]
                         )
 
-        if table[u"include-tests"] in (u"NDR", u"PDR") or \
-                u"latency" in table[u"include-tests"]:
+        if table[u"include-tests"] in (u"NDR", u"PDR", u"hoststack", u"vsap") \
+                or u"latency" in table[u"include-tests"]:
             for tst_name, tst_data in col_data[u"data"].items():
                 if tst_data[u"data"]:
                     tst_data[u"mean"] = mean(tst_data[u"data"])