Skip to content

Commit 12f467d

Browse files
committed
cope with non-numeric values in graphing
1 parent 3f480b8 commit 12f467d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

apamax/log_analyzer.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,10 @@ def formatItem(key, value, scalingfactor):
403403
# assume it's a number; try to find a concise representation to keep the HTML small
404404
value = value*scalingfactor
405405
if value == 0: return '0'
406-
if value > 100: return f'{value:.0f}'
406+
try:
407+
if value > 100: return f'{value:.0f}'
408+
except TypeError:
409+
pass # occasionally the value will be a user-defined string in which case ">" operator won't work
407410
return str(value)
408411

409412
def writeStatus(self, status=None, line=None, **extra):

0 commit comments

Comments
 (0)