[or-cvs] r22765: {arm} Couple more minor fixes for consensus tracker emails. (arm/trunk/init)

Damian Johnson atagar1 at gmail.com
Sun Aug 1 23:44:26 UTC 2010


Author: atagar
Date: 2010-08-01 23:44:25 +0000 (Sun, 01 Aug 2010)
New Revision: 22765

Modified:
   arm/trunk/init/consensusTracker.py
Log:
Couple more minor fixes for consensus tracker emails.



Modified: arm/trunk/init/consensusTracker.py
===================================================================
--- arm/trunk/init/consensusTracker.py	2010-08-01 22:31:42 UTC (rev 22764)
+++ arm/trunk/init/consensusTracker.py	2010-08-01 23:44:25 UTC (rev 22765)
@@ -12,6 +12,10 @@
 seen before, which can take quite some time to prepopulate from scratch (on the
 order of a month or so). Getting this information from karsten's metrics
 project can greatly bootstrap this.
+
+To fetch the consensus on an hourly basis you either need to have DirPort or
+FetchDirInfoEarly set in your torrc (the default, client schedule for fetching
+the consensus will miss some since each consensus is valid for two hours).
 """
 
 import os
@@ -532,6 +536,7 @@
       
       dates = list(datesToSamplings.keys())
       dates.sort()
+      dates.reverse()
       
       for date in dates:
         # stores to get the daily sums later
@@ -580,8 +585,12 @@
           hourlyEntries += hourlyCellEntry % (consensusTime, gCounts[-1], gNew[-1], getSizeLabel(gBw[-1]), mCounts[-1], mNew[-1], getSizeLabel(mBw[-1]), eCounts[-1], eNew[-1], getSizeLabel(eBw[-1]), bwLabel)
         
         # append daily summary then hourly entries
+        gCountAvg = sum(gCounts) / len(gCounts)
+        mCountAvg = sum(mCounts) / len(mCounts)
+        eCountAvg = sum(eCounts) / len(eCounts)
+        
         bwAvgLabel = getSizeLabel(sum(totalBw) / len(totalBw), 2)
-        msgHtml += dailyCellEntry % (date + " ", max(gCounts), sum(gNew), getSizeLabel(sum(gBw)), max(mCounts), sum(mNew), getSizeLabel(sum(mBw)), max(eCounts), sum(eNew), getSizeLabel(sum(eBw)), bwAvgLabel)
+        msgHtml += dailyCellEntry % (date + " ", gCountAvg, sum(gNew), getSizeLabel(sum(gBw)), mCountAvg, sum(mNew), getSizeLabel(sum(mBw)), eCountAvg, sum(eNew), getSizeLabel(sum(eBw)), bwAvgLabel)
         msgHtml += hourlyEntries
       
       msgHtml += """    </table>



More information about the tor-commits mailing list