Skip to content
This repository has been archived by the owner on Sep 22, 2023. It is now read-only.

Commit

Permalink
fix: Skip null metrics gracefully instead of crashing (#157)
Browse files Browse the repository at this point in the history
  • Loading branch information
achimnol committed Apr 6, 2021
1 parent da9a55a commit cefbabf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions changes/157.fix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Gracefully skip null-metric when printing statistics
2 changes: 2 additions & 0 deletions src/ai/backend/client/cli/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,8 @@ def _format_stats(stats):
else:
val = metric['current']
unit = ''
if val is None:
continue
ip, _, fp = val.partition('.')
max_integer_len = max(len(ip), max_integer_len)
max_fraction_len = max(len(fp), max_fraction_len)
Expand Down

0 comments on commit cefbabf

Please sign in to comment.