Skip to content

Commit

Permalink
flux ion: update stats to include failed matches
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
milroy committed Apr 27, 2024
1 parent 0feeb11 commit 9497cdd
Showing 1 changed file with 56 additions and 6 deletions.
62 changes: 56 additions & 6 deletions src/cmd/flux-ion-resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -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: ",
json.dumps(resp["match"]["succeeded"]["njobs"]),
)
print(
"Num. of Jobs Successfully Matched Since Reset: ",
json.dumps(resp["match"]["succeeded"]["njobs-reset"]),
)
print(
"Min. Successful Match Time: ",
json.dumps(resp["match"]["succeeded"]["min-match"]),
"Secs",
)
print(
"Max. Successful Match Time: ",
json.dumps(resp["match"]["succeeded"]["max-match"]),
"Secs",
)
print(
"Avg. Successful Match Time: ",
json.dumps(resp["match"]["succeeded"]["avg-match"]),
"Secs",
)
print(
"Successful Match Variance: ",
json.dumps(resp["match"]["succeeded"]["match-variance"]),
"Secs^2",
)
print(
"Num. of Jobs with Failed Matches: ",
json.dumps(resp["match"]["failed"]["njobs-failed"]),
)
print(
"Num. of Jobs with Failed Matches Since Reset: ",
json.dumps(resp["match"]["failed"]["njobs-reset-failed"]),
)
print(
"Min. Match Time of Failed Matches: ",
json.dumps(resp["match"]["failed"]["min-match-failed"]),
"Secs",
)
print(
"Max. Match Time of Failed Matches: ",
json.dumps(resp["match"]["failed"]["max-match-failed"]),
"Secs",
)
print(
"Avg. Match Time of Failed Matches: ",
json.dumps(resp["match"]["failed"]["avg-match-failed"]),
"Secs",
)
print(
"Match Variance of Failed Matches: ",
json.dumps(resp["match"]["failed"]["match-variance-failed"]),
"Secs^2",
)


def stats_clear_action(_):
Expand Down

0 comments on commit 9497cdd

Please sign in to comment.