[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [metrics-web/master] Avoid division by zero.



commit a89aa52052193562d43eaa330027b95fbd7103d7
Author: Karsten Loesing <karsten.loesing@xxxxxxx>
Date:   Mon Sep 14 08:38:09 2015 +0200

    Avoid division by zero.
    
    This error occurred a few times in late August and early September
    2015, and even though it's unclear how bytes.seconds can ever be 0, it
    seems harmless to remove these rows.
    
    Fixes #17008.
---
 modules/clients/init-userstats.sql |    1 +
 1 file changed, 1 insertion(+)

diff --git a/modules/clients/init-userstats.sql b/modules/clients/init-userstats.sql
index 7c5df3d..00b7938 100644
--- a/modules/clients/init-userstats.sql
+++ b/modules/clients/init-userstats.sql
@@ -491,6 +491,7 @@ BEGIN
       AND bytes.node = responses.node
       WHERE bytes.metric = 'bytes'
       AND responses.metric = 'responses'
+      AND bytes.seconds > 0
       GROUP BY bytes.date, bytes.node
     ) aggregated_bytes_responses
     WHERE aggregated.date = aggregated_bytes_responses.date

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits