import re
import logging
+from collections import OrderedDict
+from copy import deepcopy
+from math import log
+
import hdrh.histogram
import hdrh.codec
import pandas as pd
import plotly.offline as ploff
import plotly.graph_objs as plgo
-from collections import OrderedDict
-from copy import deepcopy
-from math import log
-
from plotly.exceptions import PlotlyError
from pal_utils import mean, stdev
hovertext.append(
f"<b>{desc[graph]}</b><br>"
f"Direction: {(u'W-E', u'E-W')[idx % 2]}<br>"
- f"Percentile: {previous_x:.5f}-{percentile:.5f}%<br>"
+ f"Percentile: "
+ f"{previous_x:.5f}-{percentile:.5f}%<br>"
f"Latency: {item.value_iterated_to}uSec"
)
xaxis.append(percentile)
hovertext.append(
f"<b>{desc[graph]}</b><br>"
f"Direction: {(u'W-E', u'E-W')[idx % 2]}<br>"
- f"Percentile: {previous_x:.5f}-{percentile:.5f}%<br>"
+ f"Percentile: "
+ f"{previous_x:.5f}-{percentile:.5f}%<br>"
f"Latency: {item.value_iterated_to}uSec"
)
previous_x = percentile
decoded = hdrh.histogram.HdrHistogram.decode(
test[u"latency"][graph][direction][u"hdrh"]
)
- except hdrh.codec.HdrLengthException:
+ except (hdrh.codec.HdrLengthException, TypeError):
logging.warning(
f"No data for direction {(u'W-E', u'E-W')[idx % 2]}"
)
)
test_type = u"HOSTSTACK"
+ elif test[u"type"] in (u"LDP_NGINX",):
+ if u"TCP_CPS" in test[u"tags"]:
+ test_type = u"VSAP_CPS"
+ y_vals[test[u"parent"]].append(
+ test[u"result"][u"cps"] / 1e6
+ )
+ elif u"TCP_RPS" in test[u"tags"]:
+ test_type = u"VSAP_RPS"
+ y_vals[test[u"parent"]].append(
+ test[u"result"][u"rps"] / 1e6
+ )
+ else:
+ continue
else:
continue
try:
val_max = max(df_y[col])
if val_max:
- y_max.append(int(val_max / 1e6) + 2)
+ y_max.append(int(val_max / 1e6))
except (ValueError, TypeError) as err:
logging.error(repr(err))
continue
if layout.get(u"title", None):
if test_type in (u"HOSTSTACK", ):
layout[u"title"] = f"<b>Bandwidth:</b> {layout[u'title']}"
+ elif test_type == u"VSAP_CPS":
+ layout[u"title"] = f"<b>CPS:</b> {layout[u'title']}"
+ layout[u"yaxis"][u"title"] = u"<b>Connection Rate [Mcps]</b>"
+ elif test_type == u"VSAP_RPS":
+ layout[u"title"] = f"<b>RPS:</b> {layout[u'title']}"
+ layout[u"yaxis"][u"title"] = u"<b>Connection Rate [Mrps]</b>"
else:
- layout[u"title"] = f"<b>Throughput:</b> {layout[u'title']}"
- if y_max:
- layout[u"yaxis"][u"range"] = [0, max(y_max)]
+ layout[u"title"] = f"<b>Tput:</b> {layout[u'title']}"
+ if y_max and max(y_max) > 1:
+ layout[u"yaxis"][u"range"] = [0, max(y_max) + 2]
plpl = plgo.Figure(data=traces, layout=layout)
# Export Plot
layout[u"title"] = f"<b>CPS:</b> {layout[u'title']}"
else:
layout[u"title"] = \
- f"<b>Throughput:</b> {layout[u'title']}"
+ f"<b>Tput:</b> {layout[u'title']}"
if data_y_max:
layout[u"yaxis"][u"range"] = [0, max(data_y_max) / 1e6 + 1]
plpl = plgo.Figure(data=traces, layout=layout)
# Add plot traces
traces = list()
- for idx in range(len(data_x)):
+ for idx, x_item in enumerate(data_x):
traces.append(
plgo.Box(
- x=[data_x[idx], ] * len(data_y[idx]),
+ x=[x_item, ] * len(data_y[idx]),
y=data_y[idx],
name=data_names[idx],
hoverinfo=u"y+name"
layout = deepcopy(plot[u"layout"])
if layout.get(u"title", None):
layout[u"title"] = (
- f"<b>Throughput:</b> {layout[u'title'].format(core=core)}"
+ f"<b>Tput:</b> {layout[u'title'].format(core=core)}"
)
if data_y_max:
layout[u"yaxis"][u"range"] = [0, max(data_y_max) + 1]
REGEX_NIC,
u"",
test_name.replace(u'-ndrpdr', u'').
- replace(u'2n1l-', u'')
+ replace(u'2n1l-', u'')
)
vals[name] = OrderedDict()
y_val_1 = test_vals[u"1"][0] / 1e6