]> git.decadent.org.uk Git - dak.git/commitdiff
logs.py
authorJoerg Jaspert <joerg@debian.org>
Tue, 16 Dec 2008 21:35:45 +0000 (22:35 +0100)
committerJoerg Jaspert <joerg@debian.org>
Tue, 16 Dec 2008 21:35:45 +0000 (22:35 +0100)
add my modifications

Signed-off-by: Joerg Jaspert <joerg@debian.org>
ChangeLog
tools/logs.py

index 390c1fc319d93aca1cf6fce8ea23eb4c18f8ec37..1db58f60a1eeed5e1754ecbc40c66c65c70f1a94 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,13 @@
 2008-12-16  Joerg Jaspert  <joerg@debian.org>
 
        * tools/logs.py: Added script from Thomas.
+       Modifications from me:
+        - Use path entries that fit ftpmaster dak user
+        - Make the bz2 extension optional for log files, so we can run it
+       out of cron.dinstall, where it is not yet compressed.
+        - Also show the two largest time killers in the totals graph.
+        - do not drop old entries from the cachefile
+        - fiddle with the color palette
 
 2008-12-15  Joerg Jaspert  <joerg@debian.org>
 
index 336a68af9798db276b99cce659cd7bf42c334c19..d77d7d20b01c39c41527b3949c82e313f84ed8f5 100755 (executable)
@@ -6,11 +6,11 @@
 import os,re,datetime, sys
 import tempfile, time
 
-ITEMS_TO_KEEP = 10
-CACHE_FILE = os.path.join(os.path.dirname(sys.argv[0]),'time_cache')
-GRAPH_DIR = '/home/tviehmann/public_html/stat'
+ITEMS_TO_KEEP = 20
+CACHE_FILE = '/srv/ftp.debian.org/misc/dinstall_time_cache'
+GRAPH_DIR = '/srv/ftp.debian.org/web/stat'
 
-LINE = re.compile(r'(?:|.*/)dinstall_(\d{4})\.(\d{2})\.(\d{2})-(\d{2}):(\d{2}):(\d{2})\.log\.bz2:'+
+LINE = re.compile(r'(?:|.*/)dinstall_(\d{4})\.(\d{2})\.(\d{2})-(\d{2}):(\d{2}):(\d{2})\.log(?:\.bz2)?:'+
                   r'Archive maintenance timestamp \d+ \(([^\)]*)\): (\d{2}):(\d{2}):(\d{2})$')
 UNSAFE = re.compile(r'[^a-zA-Z/\._:0-9\- ]')
 
@@ -19,7 +19,7 @@ graphs = {"dinstall1": {"keystolist":["pg_dump1", "i18n 1", "accepted", "make-su
                         "showothers":True},
           "dinstall2": {"keystolist":['External Updates', 'p-u-new', 'o-p-u-new', 'cruft', 'import-keyring', 'overrides', 'cleanup', 'scripts', 'mirror hardlinks', 'stats', 'compress'],
                         "showothers":False},
-          "totals":{"keystolist":[],"showothers":True}}
+          "totals":{"keystolist":["apt-ftparchive", "apt-ftparchive cleanup"],"showothers":True}}
 
 #'mirror hardlinks', 'apt-ftparchive', 'logremove', 'startup', 'import-keyring', 'release files', 'accepted', 'stats', 'o-p-u-new', 'i18n 2', 'locked part finished', 'i18n 1', 'cruft', 'pdiff', 'init', 'cleanup', , 'p-u-new', 'run-parts', 'compress', 'scripts', 'expire_dumps', 'removed', 'make-suite-file-list', 'pg_dump1', 'pg_dump2', 'overrides', 'reports', 'merkel projectb push', 'buildd', 'apt-ftparchive cleanup', 'w-b'
 
@@ -71,13 +71,13 @@ if (wantkeys-ks):
 datakeys = d.keys()
 datakeys.sort()
 
-datakeys = datakeys[-ITEMS_TO_KEEP:]
 f = open(CACHE_FILE+".tmp","w")
 for dk in datakeys:
     print >> f, dk+'\t'+'\t'.join(
       ["%s:%s"%(k,str(d[dk][k])) for k in kl if k in d[dk]])
 f.close()
 os.rename(CACHE_FILE+".tmp", CACHE_FILE)
+datakeys = datakeys[-ITEMS_TO_KEEP:]
 
 def dump_file(outfn,keystolist, showothers):
     showothers = (showothers and 1) or 0
@@ -98,10 +98,8 @@ def dump_file(outfn,keystolist, showothers):
   #d[["ts"]] <- as.POSIXct(d[["timestamp"]])
   k = setdiff(names(d),c("ts","timestamp"))
   #palette(rainbow(max(length(k),2)))
-  palette(c("midnightblue", "gold", "turquoise", "cyan", "black", "red", "OrangeRed", "green3", "blue",
-       "magenta", "tomato4",
-        "violetred2","thistle4", "steelblue2", "springgreen4",
-       "salmon","gray"))
+  palette(c("midnightblue", "gold", "turquoise", "plum4", "palegreen1", "OrangeRed", "green4", "blue",
+       "magenta", "darkgoldenrod3", "tomato4", "violetred2","thistle4", "steelblue2", "springgreen4", "salmon","gray"))
   #plot(d[["runtime"]],d[["compress"]],type="l",col="blue")
   #lines(d[["runtime"]],d[["logremove"]],type="l",col="red")
   #legend(as.POSIXct("2008-12-05"),9500,"logremove",col="red",lty=1)