[mirrorbrain-commits] [mod_stats] r42 - in /trunk/tools: dlcount.py ooo.conf

From: <poeml_at_mirrorbrain.org>
Date: Thu, 26 Nov 2009 13:40:15 -0000
Author: poeml
Date: Thu Nov 26 14:40:13 2009
New Revision: 42

URL: http://svn.mirrorbrain.org/viewvc/mod_stats?rev=42&view=rev
Log:
set a default value on StatsDupWindow

Modified:
    trunk/tools/dlcount.py
    trunk/tools/ooo.conf

Modified: trunk/tools/dlcount.py
URL: http://svn.mirrorbrain.org/viewvc/mod_stats/trunk/tools/dlcount.py?rev=42&r1=41&r2=42&view=diff
==============================================================================
--- trunk/tools/dlcount.py (original)
+++ trunk/tools/dlcount.py Thu Nov 26 14:40:13 2009
@@ -178,6 +178,7 @@
     conf = {}
     for i in known_directives_lower:
         conf[i] = list()
+    conf['statsdupwindow'] = 200
 
     for line in open(filename):
         # remove trailing and leading whitespace and newlines
@@ -218,7 +219,6 @@
             subst = m.group(2).replace('\\"', '"')
             regex_compiled = re.compile(regex)
             conf[directive].append((regex_compiled, subst, regex))
-            #print conf['statsprefilter']
 
         elif directive in ['statsignoreip']:
             conf[directive].append(val)
@@ -227,10 +227,14 @@
             sys.exit('unparsed directive (implementation needed)', directive)
 
     # set defaults for directives that didn't occur in the config
-    if len(conf['statslogmask']) == 0:
+    if not len(conf['statslogmask']):
         regex = '^(\S+).+"GET (\S*) HTTP.*" (200|302) [^"]+ "([^"]*)" "([^"]*)".* \w\w:(\w\w) ASN:'
         regex_compiled = re.compile(regex)
-        conf['statslogmask'].append((regex_compiled, regex))
+        conf['statslogmask'] = ((regex_compiled, regex))
+
+    #import pprint
+    #pprint.pprint(conf)
+    #sys.exit(0)
 
     return conf
     
@@ -246,9 +250,6 @@
         sys.exit('Usage: dlcount CONFIGFILE LOGFILE [LOGFILE ...]')
 
     conf = readconf(sys.argv[1])
-    #import pprint
-    #pprint.pprint(conf)
-
 
     known = RingBuffer(conf['statsdupwindow'])
 

Modified: trunk/tools/ooo.conf
URL: http://svn.mirrorbrain.org/viewvc/mod_stats/trunk/tools/ooo.conf?rev=42&r1=41&r2=42&view=diff
==============================================================================
--- trunk/tools/ooo.conf (original)
+++ trunk/tools/ooo.conf Thu Nov 26 14:40:13 2009
@@ -10,7 +10,7 @@
 #
 # 200 is returned for files that are not on mirrors, and for metalinks
 #
-#StatsLogMask "^(\S+).+\"GET (\S*) HTTP.*\" (200|302) [^\"]+ \"([^\"]*)\" \"([^\"]*)\".* \w\w:(\w\w) ASN:"
+StatsLogMask "^(\S+).+\"GET (\S*) HTTP.*\" (200|302) [^\"]+ \"([^\"]*)\" \"([^\"]*)\".* \w\w:(\w\w) ASN:"
 
 
 # define the size of a sliding window for remembering the last requests,




_______________________________________________
mirrorbrain-commits mailing list
Archive: http://mirrorbrain.org/archive/mirrorbrain-commits/

Note: To remove yourself from this list, send a mail with the content
 	unsubscribe
to the address mirrorbrain-commits-request_at_mirrorbrain.org
Received on Thu Nov 26 2009 - 13:40:17 GMT

This archive was generated by hypermail 2.2.0 : Thu Nov 26 2009 - 13:45:25 GMT