Code Review
/
csit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
CSIT-1124: Support multi-sample tests
[csit.git]
/
resources
/
tools
/
presentation
/
generator_tables.py
diff --git
a/resources/tools/presentation/generator_tables.py
b/resources/tools/presentation/generator_tables.py
index
43117cc
..
d42c734
100644
(file)
--- a/
resources/tools/presentation/generator_tables.py
+++ b/
resources/tools/presentation/generator_tables.py
@@
-17,7
+17,6
@@
import logging
import csv
import logging
import csv
-import pandas as pd
from string import replace
from collections import OrderedDict
from string import replace
from collections import OrderedDict
@@
-185,6
+184,8
@@
def table_performance_improvements(table, input_data):
"""Generate the table(s) with algorithm: table_performance_improvements
specified in the specification file.
"""Generate the table(s) with algorithm: table_performance_improvements
specified in the specification file.
+ # FIXME: Not used now.
+
:param table: Table to generate.
:param input_data: Data to process.
:type table: pandas.Series
:param table: Table to generate.
:param input_data: Data to process.
:type table: pandas.Series
@@
-611,7
+612,7
@@
def table_performance_comparison_mrr(table, input_data):
"cmp-data": list()}
try:
tbl_dict[tst_name]["ref-data"].\
"cmp-data": list()}
try:
tbl_dict[tst_name]["ref-data"].\
- append(tst_data["result"]["
throughput"]
)
+ append(tst_data["result"]["
receive-rate"].avg
)
except TypeError:
pass # No data in output.xml for this test
except TypeError:
pass # No data in output.xml for this test
@@
-620,7
+621,7
@@
def table_performance_comparison_mrr(table, input_data):
for tst_name, tst_data in data[job][str(build)].iteritems():
try:
tbl_dict[tst_name]["cmp-data"].\
for tst_name, tst_data in data[job][str(build)].iteritems():
try:
tbl_dict[tst_name]["cmp-data"].\
- append(tst_data["result"]["
throughput"]
)
+ append(tst_data["result"]["
receive-rate"].avg
)
except KeyError:
pass
except TypeError:
except KeyError:
pass
except TypeError:
@@
-723,21
+724,21
@@
def table_performance_trending_dashboard(table, input_data):
"data": OrderedDict()}
try:
tbl_dict[tst_name]["data"][str(build)] = \
"data": OrderedDict()}
try:
tbl_dict[tst_name]["data"][str(build)] = \
- tst_data["result"]["
throughput
"]
+ tst_data["result"]["
receive-rate
"]
except (TypeError, KeyError):
pass # No data in output.xml for this test
tbl_lst = list()
for tst_name in tbl_dict.keys():
except (TypeError, KeyError):
pass # No data in output.xml for this test
tbl_lst = list()
for tst_name in tbl_dict.keys():
- if len(tbl_dict[tst_name]["data"]) < 2:
+ data_t = tbl_dict[tst_name]["data"]
+ if len(data_t) < 2:
continue
continue
- data_t = pd.Series(tbl_dict[tst_name]["data"])
-
classification_lst, avgs = classify_anomalies(data_t)
classification_lst, avgs = classify_anomalies(data_t)
- win_size = min(data_t.size, table["window"])
- long_win_size = min(data_t.size, table["long-trend-window"])
+ win_size = min(len(data_t), table["window"])
+ long_win_size = min(len(data_t), table["long-trend-window"])
+
try:
max_long_avg = max(
[x for x in avgs[-long_win_size:-win_size]
try:
max_long_avg = max(
[x for x in avgs[-long_win_size:-win_size]
@@
-970,10
+971,10
@@
def table_failed_tests(table, input_data):
# Prepare the header of the tables
header = ["Test Case",
# Prepare the header of the tables
header = ["Test Case",
- "Fails [#]",
- "Last Fail
[Timestamp
]",
- "Last Fail
[VPP Buil
d]",
- "Last Fail
[CSIT Buil
d]"]
+ "Fail
ure
s [#]",
+ "Last Fail
ure [Time
]",
+ "Last Fail
ure [VPP-Build-I
d]",
+ "Last Fail
ure [CSIT-Job-Build-I
d]"]
# Generate the data for the table according to the model in the table
# specification
# Generate the data for the table according to the model in the table
# specification
@@
-1070,14
+1071,9
@@
def table_failed_tests_html(table, input_data):
th.text = item
# Rows:
th.text = item
# Rows:
- colors = {"very-bad": ("#ffcccc", "#ff9999"),
- "bad": ("#e9f1fb", "#d4e4f7")}
+ colors = ("#e9f1fb", "#d4e4f7")
for r_idx, row in enumerate(csv_lst[1:]):
for r_idx, row in enumerate(csv_lst[1:]):
- if int(row[1]) > 7:
- color = "very-bad"
- else:
- color = "bad"
- background = colors[color][r_idx % 2]
+ background = colors[r_idx % 2]
tr = ET.SubElement(failed_tests, "tr", attrib=dict(bgcolor=background))
# Columns:
tr = ET.SubElement(failed_tests, "tr", attrib=dict(bgcolor=background))
# Columns: