Code Review
/
csit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Report: Add curr vs prev comp for 3n-snr
[csit.git]
/
resources
/
tools
/
presentation
/
generator_plots.py
diff --git
a/resources/tools/presentation/generator_plots.py
b/resources/tools/presentation/generator_plots.py
index
1b95030
..
ce1fbd3
100644
(file)
--- a/
resources/tools/presentation/generator_plots.py
+++ b/
resources/tools/presentation/generator_plots.py
@@
-1,4
+1,4
@@
-# Copyright (c) 202
1
Cisco and/or its affiliates.
+# Copyright (c) 202
3
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:
# 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:
@@
-145,24
+145,32
@@
def plot_statistics(plot, input_data):
d_y_fail = meta[u"tests_failed"]
minutes = meta[u"elapsedtime"] // 60000
duration = f"{(minutes // 60):02d}:{(minutes % 60):02d}"
d_y_fail = meta[u"tests_failed"]
minutes = meta[u"elapsedtime"] // 60000
duration = f"{(minutes // 60):02d}:{(minutes % 60):02d}"
- version = meta
[u"version"]
+ version = meta
.get(u"version", u"")
except (KeyError, IndexError, ValueError, AttributeError):
continue
data_x.append(date)
data_y_pass.append(d_y_pass)
data_y_fail.append(d_y_fail)
data_y_duration.append(minutes)
except (KeyError, IndexError, ValueError, AttributeError):
continue
data_x.append(date)
data_y_pass.append(d_y_pass)
data_y_fail.append(d_y_fail)
data_y_duration.append(minutes)
+ if u"vpp" in job:
+ sut = u"vpp"
+ elif u"dpdk" in job:
+ sut = u"dpdk"
+ elif u"trex" in job:
+ sut = u"trex"
+ else:
+ sut = u""
hover_text.append(hover_str.format(
date=date,
passed=d_y_pass,
failed=d_y_fail,
duration=duration,
hover_text.append(hover_str.format(
date=date,
passed=d_y_pass,
failed=d_y_fail,
duration=duration,
- sut=
u"vpp" if u"vpp" in job else u"dpdk"
,
+ sut=
sut
,
build=version,
test=u"mrr" if u"mrr" in job else u"ndrpdr",
period=u"daily" if u"daily" in job else u"weekly",
build_nr=build_nr,
build=version,
test=u"mrr" if u"mrr" in job else u"ndrpdr",
period=u"daily" if u"daily" in job else u"weekly",
build_nr=build_nr,
- testbed=meta
[u"testbed"]
+ testbed=meta
.get(u"testbed", u"")
))
traces = [
))
traces = [
@@
-769,7
+777,6
@@
def plot_perf_box_name(plot, input_data):
else:
data_y = [y / 1e6 if y else None for y in df_y[col]]
kwargs = dict(
else:
data_y = [y / 1e6 if y else None for y in df_y[col]]
kwargs = dict(
- x=[str(i + 1) + u'.'] * len(df_y[col]),
y=data_y,
name=(
f"{i + 1}. "
y=data_y,
name=(
f"{i + 1}. "
@@
-781,6
+788,7
@@
def plot_perf_box_name(plot, input_data):
)
if test_type in (u"SOAK", ):
kwargs[u"boxpoints"] = u"all"
)
if test_type in (u"SOAK", ):
kwargs[u"boxpoints"] = u"all"
+ kwargs[u"jitter"] = 0.3
traces.append(plgo.Box(**kwargs))
traces.append(plgo.Box(**kwargs))
@@
-795,6
+803,8
@@
def plot_perf_box_name(plot, input_data):
try:
# Create plot
layout = deepcopy(plot[u"layout"])
try:
# Create plot
layout = deepcopy(plot[u"layout"])
+ layout[u"xaxis"][u"tickvals"] = [i for i in range(len(y_vals))]
+ layout[u"xaxis"][u"ticktext"] = [str(i + 1) for i in range(len(y_vals))]
if layout.get(u"title", None):
if test_type in (u"HOSTSTACK", ):
layout[u"title"] = f"<b>Bandwidth:</b> {layout[u'title']}"
if layout.get(u"title", None):
if test_type in (u"HOSTSTACK", ):
layout[u"title"] = f"<b>Bandwidth:</b> {layout[u'title']}"
@@
-891,20
+901,23
@@
def plot_ndrpdr_box_name(plot, input_data):
REGEX_NIC, u'', key.lower().replace(u'-ndrpdr', u'').
replace(u'2n1l-', u'')
)
REGEX_NIC, u'', key.lower().replace(u'-ndrpdr', u'').
replace(u'2n1l-', u'')
)
- traces.append(
- plgo.Box(
- x=[data_x[idx], ] * len(data_x),
- y=[y / 1e6 if y else None for y in vals],
- name=(
- f"{idx+1}."
- f"({len(vals):02d} "
- f"run"
- f"{u's' if len(vals) > 1 else u''}) "
- f"{name}"
- ),
- hoverinfo=u"y+name"
- )
+ kwargs = dict(
+ y=[y / 1e6 if y else None for y in vals],
+ name=(
+ f"{idx + 1}."
+ f"({len(vals):02d} "
+ f"run"
+ f"{u's' if len(vals) > 1 else u''}) "
+ f"{name}"
+ ),
+ hoverinfo=u"y+name"
)
)
+ box_points = plot.get(u"boxpoints", u"all")
+ if box_points in \
+ (u"all", u"outliers", u"suspectedoutliers", False):
+ kwargs[u"boxpoints"] = box_points
+ kwargs[u"jitter"] = 0.3
+ traces.append(plgo.Box(**kwargs))
try:
data_y_max.append(max(vals))
except ValueError as err:
try:
data_y_max.append(max(vals))
except ValueError as err:
@@
-912,6
+925,9
@@
def plot_ndrpdr_box_name(plot, input_data):
try:
# Create plot
layout = deepcopy(plot[u"layout"])
try:
# Create plot
layout = deepcopy(plot[u"layout"])
+ layout[u"xaxis"][u"tickvals"] = [i for i in range(len(data_y))]
+ layout[u"xaxis"][u"ticktext"] = \
+ [str(i + 1) for i in range(len(data_y))]
if layout.get(u"title", None):
layout[u"title"] = \
layout[u'title'].format(core=core, test_type=ttype)
if layout.get(u"title", None):
layout[u"title"] = \
layout[u'title'].format(core=core, test_type=ttype)
@@
-1000,18
+1016,23
@@
def plot_mrr_box_name(plot, input_data):
# Add plot traces
traces = list()
for idx, x_item in enumerate(data_x):
# Add plot traces
traces = list()
for idx, x_item in enumerate(data_x):
- traces.append(
- plgo.Box(
- x=[x_item, ] * len(data_y[idx]),
- y=data_y[idx],
- name=data_names[idx],
- hoverinfo=u"y+name"
- )
+ kwargs = dict(
+ y=data_y[idx],
+ name=data_names[idx],
+ hoverinfo=u"y+name"
)
)
+ box_points = plot.get(u"boxpoints", u"all")
+ if box_points in (u"all", u"outliers", u"suspectedoutliers", False):
+ kwargs[u"boxpoints"] = box_points
+ kwargs["jitter"] = 0.3
+ traces.append(plgo.Box(**kwargs))
try:
# Create plot
layout = deepcopy(plot[u"layout"])
try:
# Create plot
layout = deepcopy(plot[u"layout"])
+ layout[u"xaxis"][u"tickvals"] = [i for i in range(len(data_y))]
+ layout[u"xaxis"][u"ticktext"] = \
+ [str(i + 1) for i in range(len(data_y))]
if layout.get(u"title", None):
layout[u"title"] = (
f"<b>Tput:</b> {layout[u'title'].format(core=core)}"
if layout.get(u"title", None):
layout[u"title"] = (
f"<b>Tput:</b> {layout[u'title'].format(core=core)}"
@@
-1194,6
+1215,10
@@
def plot_tsa_name(plot, input_data):
limit = plot[u"limits"][u"nic"][u"cx556a"]
elif u"e810cq" in test_name:
limit = plot[u"limits"][u"nic"][u"e810cq"]
limit = plot[u"limits"][u"nic"][u"cx556a"]
elif u"e810cq" in test_name:
limit = plot[u"limits"][u"nic"][u"e810cq"]
+ elif u"e810xxv" in test_name:
+ limit = plot[u"limits"][u"nic"][u"e810xxv"]
+ elif u"e822cq" in test_name:
+ limit = plot[u"limits"][u"nic"][u"e822cq"]
else:
limit = 0
if limit > nic_limit:
else:
limit = 0
if limit > nic_limit:
@@
-1514,8
+1539,6
@@
def plot_nf_heatmap(plot, input_data):
regex_test_name = re.compile(r'^.*-(\d+ch|\d+pl)-'
r'(\d+mif|\d+vh)-'
r'(\d+vm\d+t|\d+dcr\d+t|\d+dcr\d+c).*$')
regex_test_name = re.compile(r'^.*-(\d+ch|\d+pl)-'
r'(\d+mif|\d+vh)-'
r'(\d+vm\d+t|\d+dcr\d+t|\d+dcr\d+c).*$')
- vals = dict()
-
# Transform the data
logging.info(
f" Creating the data set for the {plot.get(u'type', u'')} "
# Transform the data
logging.info(
f" Creating the data set for the {plot.get(u'type', u'')} "
@@
-1532,6
+1555,7
@@
def plot_nf_heatmap(plot, input_data):
for ttype in plot.get(u"test-type", (u"ndr", u"pdr")):
for core in plot.get(u"core", tuple()):
for ttype in plot.get(u"test-type", (u"ndr", u"pdr")):
for core in plot.get(u"core", tuple()):
+ vals = dict()
for item in plot.get(u"include", tuple()):
reg_ex = re.compile(str(item.format(core=core)).lower())
for job in in_data:
for item in plot.get(u"include", tuple()):
reg_ex = re.compile(str(item.format(core=core)).lower())
for job in in_data: