[tor-commits] [webstats/master] Adapt for metrics

sebastian at torproject.org sebastian at torproject.org
Thu Sep 15 11:57:59 UTC 2016


commit 1f4d0c999c4a38c1f8288f1c70f94f0a25bc03a7
Author: Sebastian Hahn <sebastian at torproject.org>
Date:   Thu Sep 15 13:57:51 2016 +0200

    Adapt for metrics
---
 src/sanitize.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/sanitize.py b/src/sanitize.py
index d6baf41..9fae32c 100755
--- a/src/sanitize.py
+++ b/src/sanitize.py
@@ -58,7 +58,7 @@ with open(yesterday_fname, 'a') as file_old:
         for line in fileinput.input(sys.argv[1]):
             matched = is_valid_regex.match(line)
             if matched is None:
-                print(line, "Last line does not match critera", file=sys.stderr)
+                #print(line, "Last line does not match critera", file=sys.stderr)
                 continue
             date = dateutil.parser.parse(matched.group(2))
             if today != date and day_before != date:
@@ -74,9 +74,10 @@ with open(yesterday_fname, 'a') as file_old:
                 #print(matched.expand(sanitized_regex), file=sys.stderr, end="")
                 continue
 
-            if matched.group(1) == "0":
+            # metrics weblogs don't start lines with 0.0.0.0 :(
+            #if matched.group(1) == "0":
                 #print(matched.expand(sanitized_regex), file=sys.stderr, end="")
-                continue
+            #    continue
 
             if today == date:
                 file_new.write(matched.expand(sanitized_regex))



More information about the tor-commits mailing list