From fea2bbe7edc613963ebe7db1029b8a108c5e7eed Mon Sep 17 00:00:00 2001 From: Tibor Frank Date: Wed, 6 May 2020 14:38:29 +0200 Subject: Trending: NDRPDR dashboard Change-Id: I7f4c84dd47874c484f34f389b93de635c66a77c1 Signed-off-by: Tibor Frank (cherry picked from commit 48cd54ff00049d58494834d25d3f0ac846ce4017) (cherry picked from commit 8cd8cd07576857ba9c5d75059889f011fb2881dd) --- resources/tools/presentation/generator_cpta.py | 52 ++++++++++++++------------ 1 file changed, 29 insertions(+), 23 deletions(-) (limited to 'resources/tools/presentation/generator_cpta.py') 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): -- cgit 1.2.3-korg