From 6c8b6064e91485ea31d85e32884d41f8e86daf0c Mon Sep 17 00:00:00 2001 From: Daniel Milroy Date: Thu, 25 Apr 2024 19:35:13 -0700 Subject: [PATCH] flux-ion: update stats to include failed matches Problem: flux ion does not report the stats on failed matches collected and returned via RPC from the resource module. Add the ability to output the stats. --- src/cmd/flux-ion-resource.py | 62 ++++++++++++++++++++++++++++++++---- 1 file changed, 56 insertions(+), 6 deletions(-) diff --git a/src/cmd/flux-ion-resource.py b/src/cmd/flux-ion-resource.py index 4dd1ee15e..ab482e340 100755 --- a/src/cmd/flux-ion-resource.py +++ b/src/cmd/flux-ion-resource.py @@ -224,12 +224,62 @@ def stat_action(_): print("Graph Load Time: ", resp["load-time"], "Secs") print("Graph Upime: ", resp["graph-uptime"], "Secs") print("Time Since Stats Reset: ", resp["time-since-reset"], "Secs") - print("Num. of Total Jobs Matched: ", resp["njobs"]) - print("Num. of Jobs Matched Since Reset: ", resp["njobs-reset"]) - print("Min. Match Time: ", resp["min-match"], "Secs") - print("Max. Match Time: ", resp["max-match"], "Secs") - print("Avg. Match Time: ", resp["avg-match"], "Secs") - print("Match Variance: ", resp["match-variance"], "Secs^2") + print( + "Num. of Total Jobs Successfully Matched: ", + resp["match"]["succeeded"]["njobs"], + ) + print( + "Num. of Jobs Successfully Matched Since Reset: ", + resp["match"]["succeeded"]["njobs-reset"], + ) + print( + "Min. Successful Match Time: ", + resp["match"]["succeeded"]["stats"]["min"], + "Secs", + ) + print( + "Max. Successful Match Time: ", + resp["match"]["succeeded"]["stats"]["max"], + "Secs", + ) + print( + "Avg. Successful Match Time: ", + resp["match"]["succeeded"]["stats"]["avg"], + "Secs", + ) + print( + "Successful Match Variance: ", + resp["match"]["succeeded"]["stats"]["variance"], + "Secs^2", + ) + print( + "Num. of Jobs with Failed Matches: ", + resp["match"]["failed"]["njobs"], + ) + print( + "Num. of Jobs with Failed Matches Since Reset: ", + resp["match"]["failed"]["njobs-reset"], + ) + print( + "Min. Match Time of Failed Matches: ", + resp["match"]["failed"]["stats"]["min"], + "Secs", + ) + print( + "Max. Match Time of Failed Matches: ", + resp["match"]["failed"]["stats"]["max"], + "Secs", + ) + print( + "Avg. Match Time of Failed Matches: ", + resp["match"]["failed"]["stats"]["avg"], + "Secs", + ) + print( + "Match Variance of Failed Matches: ", + resp["match"]["failed"]["stats"]["variance"], + "Secs^2", + ) def stats_clear_action(_):