X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=resources%2Ftools%2Fpresentation%2Fgenerator_cpta.py;h=a308f64e2e7406b7486104e07db7da3616f39446;hb=48cd54ff00049d58494834d25d3f0ac846ce4017;hp=511800a9885d6aafdb5ba48e2a04e85655366098;hpb=007b6075fa425f8ff906bc80f9277e2281ab6b45;p=csit.git
diff --git a/resources/tools/presentation/generator_cpta.py b/resources/tools/presentation/generator_cpta.py
index 511800a988..a308f64e2e 100644
--- a/resources/tools/presentation/generator_cpta.py
+++ b/resources/tools/presentation/generator_cpta.py
@@ -146,7 +146,7 @@ def generate_cpta(spec, data):
def _generate_trending_traces(in_data, job_name, build_info,
- show_trend_line=True, name=u"", color=u""):
+ name=u"", color=u""):
"""Generate the trending traces:
- samples,
- outliers, regress, progress
@@ -155,13 +155,11 @@ def _generate_trending_traces(in_data, job_name, build_info,
:param in_data: Full data set.
:param job_name: The name of job which generated the data.
:param build_info: Information about the builds.
- :param show_trend_line: Show moving median (trending plot).
:param name: Name of the plot
:param color: Name of the color for the plot.
:type in_data: OrderedDict
:type job_name: str
:type build_info: dict
- :type show_trend_line: bool
:type name: str
:type color: str
:returns: Generated traces (list) and the evaluated result.
@@ -183,7 +181,7 @@ def _generate_trending_traces(in_data, job_name, build_info,
str_key = str(key)
date = build_info[job_name][str_key][0]
hover_str = (u"date: {date}
"
- u"value [Mpps]: {value:.3f}
"
+ u"average [Mpps]: {value:.3f}
"
u"stdev [Mpps]: {stdev:.3f}
"
u"{sut}-ref: {build}
"
u"csit-ref: mrr-{period}-build-{build_nr}
"
@@ -216,8 +214,9 @@ def _generate_trending_traces(in_data, job_name, build_info,
for key, value in zip(xaxis, data_y_pps):
data_pd[key] = value
- anomaly_classification, avgs_pps = classify_anomalies(data_pd)
+ anomaly_classification, avgs_pps, stdevs_pps = classify_anomalies(data_pd)
avgs_mpps = [avg_pps / 1e6 for avg_pps in avgs_pps]
+ stdevs_mpps = [stdev_pps / 1e6 for stdev_pps in stdevs_pps]
anomalies = OrderedDict()
anomalies_colors = list()
@@ -258,23 +257,30 @@ def _generate_trending_traces(in_data, job_name, build_info,
)
traces = [trace_samples, ]
- if show_trend_line:
- trace_trend = plgo.Scatter(
- x=xaxis,
- y=avgs_mpps,
- mode=u"lines",
- line={
- u"shape": u"linear",
- u"width": 1,
- u"color": color,
- },
- showlegend=False,
- legendgroup=name,
- name=f"{name}",
- text=[f"trend [Mpps]: {avg:.3f}" for avg in avgs_mpps],
- hoverinfo=u"text+name"
+ trend_hover_text = list()
+ for idx in range(len(data_x)):
+ trend_hover_str = (
+ f"trend [Mpps]: {avgs_mpps[idx]:.3f}
"
+ f"stdev [Mpps]: {stdevs_mpps[idx]:.3f}"
)
- traces.append(trace_trend)
+ trend_hover_text.append(trend_hover_str)
+
+ trace_trend = plgo.Scatter(
+ x=xaxis,
+ y=avgs_mpps,
+ mode=u"lines",
+ line={
+ u"shape": u"linear",
+ u"width": 1,
+ u"color": color,
+ },
+ showlegend=False,
+ legendgroup=name,
+ name=f"{name}",
+ text=trend_hover_text,
+ hoverinfo=u"text+name"
+ )
+ traces.append(trace_trend)
trace_anomalies = plgo.Scatter(
x=list(anomalies.keys()),
@@ -354,8 +360,8 @@ def _generate_all_charts(spec, input_data):
# Transform the data
logging.info(
- f" Creating the data set for the {graph.get(u'type', u'')} "
- f"{graph.get(u'title', u'')}."
+ f" Creating the data set for the {graph.get(u'type', u'')} "
+ f"{graph.get(u'title', u'')}."
)
if graph.get(u"include", None):