aboutsummaryrefslogtreecommitdiffstats
path: root/resources/tools/dash
diff options
context:
space:
mode:
authorVratko Polak <vrpolak@cisco.com>2022-05-20 10:27:49 +0200
committerTibor Frank <tifrank@cisco.com>2022-05-23 07:16:40 +0000
commit72766c8177fb76ac5ca4cbbfe616c19ec4a9a97a (patch)
tree1f8fecdb6c080cb662f11f4088681964fb3eca02 /resources/tools/dash
parent01c8e09d4036daf1f6b5d26bdc48b9a723641005 (diff)
fix(dash): improve date formatting in hover
Bring it closer to RFC 3339 while keeping spaces. The fully compatible format (2022-03-29T08:45:02Z) may look too exotic for average human. Dates other than in hover (e.g. in Time Period selection) are not affected by this Change. Change-Id: Ic5033d1b0db8505b0919e6a1392e28004c718f21 Signed-off-by: Vratko Polak <vrpolak@cisco.com>
Diffstat (limited to 'resources/tools/dash')
-rw-r--r--resources/tools/dash/app/pal/stats/graphs.py2
-rw-r--r--resources/tools/dash/app/pal/trending/graphs.py6
2 files changed, 4 insertions, 4 deletions
diff --git a/resources/tools/dash/app/pal/stats/graphs.py b/resources/tools/dash/app/pal/stats/graphs.py
index db6937402a..c1f58f2405 100644
--- a/resources/tools/dash/app/pal/stats/graphs.py
+++ b/resources/tools/dash/app/pal/stats/graphs.py
@@ -47,7 +47,7 @@ def graph_statistics(df: pd.DataFrame, job:str, layout: dict,
for _, row in data.iterrows():
d_type = "trex" if row["dut_type"] == "none" else row["dut_type"]
hover_itm = (
- f"date: {row['start_time'].strftime('%d-%m-%Y %H:%M:%S')}<br>"
+ f"date: {row['start_time'].strftime('%Y-%m-%d %H:%M:%S')}<br>"
f"duration: "
f"{(int(row['duration']) // 3600):02d}:"
f"{((int(row['duration']) % 3600) // 60):02d}<br>"
diff --git a/resources/tools/dash/app/pal/trending/graphs.py b/resources/tools/dash/app/pal/trending/graphs.py
index a3357e49fb..36c19495a3 100644
--- a/resources/tools/dash/app/pal/trending/graphs.py
+++ b/resources/tools/dash/app/pal/trending/graphs.py
@@ -213,7 +213,7 @@ def _generate_trending_traces(ttype: str, name: str, df: pd.DataFrame,
for _, row in df.iterrows():
d_type = "trex" if row["dut_type"] == "none" else row["dut_type"]
hover_itm = (
- f"date: {row['start_time'].strftime('%d-%m-%Y %H:%M:%S')}<br>"
+ f"date: {row['start_time'].strftime('%Y-%m-%d %H:%M:%S')}<br>"
f"<prop> [{row[_UNIT[ttype]]}]: {row[_VALUE[ttype]]:,.0f}<br>"
f"<stdev>"
f"{d_type}-ref: {row['dut_version']}<br>"
@@ -238,7 +238,7 @@ def _generate_trending_traces(ttype: str, name: str, df: pd.DataFrame,
for avg, stdev, (_, row) in zip(trend_avg, trend_stdev, df.iterrows()):
d_type = "trex" if row["dut_type"] == "none" else row["dut_type"]
hover_itm = (
- f"date: {row['start_time'].strftime('%d-%m-%Y %H:%M:%S')}<br>"
+ f"date: {row['start_time'].strftime('%Y-%m-%d %H:%M:%S')}<br>"
f"trend [pps]: {avg:,.0f}<br>"
f"stdev [pps]: {stdev:,.0f}<br>"
f"{d_type}-ref: {row['dut_version']}<br>"
@@ -294,7 +294,7 @@ def _generate_trending_traces(ttype: str, name: str, df: pd.DataFrame,
anomaly_y.append(trend_avg[idx])
anomaly_color.append(_ANOMALY_COLOR[anomaly])
hover_itm = (
- f"date: {x_axis[idx].strftime('%d-%m-%Y %H:%M:%S')}<br>"
+ f"date: {x_axis[idx].strftime('%Y-%m-%d %H:%M:%S')}<br>"
f"trend [pps]: {trend_avg[idx]:,.0f}<br>"
f"classification: {anomaly}"
)