X-Git-Url: https://gerrit.fd.io/r/gitweb?p=csit.git;a=blobdiff_plain;f=resources%2Ftools%2Fdash%2Fapp%2Fpal%2Ftrending%2Fgraphs.py;fp=resources%2Ftools%2Fdash%2Fapp%2Fpal%2Ftrending%2Fgraphs.py;h=895055816635a9d93d76a30ea7889c1ba14976c9;hp=150b7056ba7d680e0992b96d4c802a920299b38f;hb=2f6295d7c63b7e231b0198ee055468b2fc54fa94;hpb=16fba5d038e11d16049abd62107880ae5624d383 diff --git a/resources/tools/dash/app/pal/trending/graphs.py b/resources/tools/dash/app/pal/trending/graphs.py index 150b7056ba..8950558166 100644 --- a/resources/tools/dash/app/pal/trending/graphs.py +++ b/resources/tools/dash/app/pal/trending/graphs.py @@ -237,7 +237,10 @@ def _generate_trending_traces(ttype: str, name: str, df: pd.DataFrame, return list() x_axis = df["start_time"].tolist() - y_data = [itm * norm_factor for itm in df[_VALUE[ttype]].tolist()] + if ttype == "pdr-lat": + y_data = [(itm / norm_factor) for itm in df[_VALUE[ttype]].tolist()] + else: + y_data = [(itm * norm_factor) for itm in df[_VALUE[ttype]].tolist()] anomalies, trend_avg, trend_stdev = _classify_anomalies( {k: v for k, v in zip(x_axis, y_data)} @@ -245,11 +248,11 @@ def _generate_trending_traces(ttype: str, name: str, df: pd.DataFrame, hover = list() customdata = list() - for _, row in df.iterrows(): + for idx, (_, row) in enumerate(df.iterrows()): d_type = "trex" if row["dut_type"] == "none" else row["dut_type"] hover_itm = ( f"date: {row['start_time'].strftime('%Y-%m-%d %H:%M:%S')}
" - f" [{row[_UNIT[ttype]]}]: {row[_VALUE[ttype]]:,.0f}
" + f" [{row[_UNIT[ttype]]}]: {y_data[idx]:,.0f}
" f"" f"{d_type}-ref: {row['dut_version']}
" f"csit-ref: {row['job']}/{row['build']}
"