You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when you make a request with livestatus for the average of something (e.g. Get services\nStats: avg latency), you get back the sum and not the avg. Copy-and-paste I assume ^^
Here's the fix
diff --git a/bad/modules/livestatus_broker/livestatus_query.py b/good/modules/livestatus_broker/livestatus_query.py
index becabab..5bf7432 100644
--- a/bad/modules/livestatus_broker/livestatus_query.py
+++ b/good/modules/livestatus_broker/livestatus_query.py
@@ -835,7 +835,7 @@ class LiveStatusQuery(object):
def avg_postproc(item):
if item != []:
return sum(float(getattr(obj, attribute)(self)) for obj in item)
return (sum(float(getattr(obj, attribute)(self)) for obj in item) / len(item) )
return 0
def std_postproc(item):
Hi,
when you make a request with livestatus for the average of something (e.g. Get services\nStats: avg latency), you get back the sum and not the avg. Copy-and-paste I assume ^^
Here's the fix
Original ticket : shinken-solutions/shinken#990
The text was updated successfully, but these errors were encountered: