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

Commit cefbabf

Browse files
authored
fix: Skip null metrics gracefully instead of crashing (#157)
1 parent da9a55a commit cefbabf

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

changes/157.fix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Gracefully skip null-metric when printing statistics

src/ai/backend/client/cli/run.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,8 @@ def _format_stats(stats):
241241
else:
242242
val = metric['current']
243243
unit = ''
244+
if val is None:
245+
continue
244246
ip, _, fp = val.partition('.')
245247
max_integer_len = max(len(ip), max_integer_len)
246248
max_fraction_len = max(len(fp), max_fraction_len)

0 commit comments

Comments
 (0)