Author: rgardler
Date: Wed Nov 17 22:02:29 2010
New Revision: 1036246
URL: http://svn.apache.org/viewvc?rev=1036246&view=rev
Log:
Output stats as CSV for external processing
Modified:
labs/agora/src/python/process.py
Modified: labs/agora/src/python/process.py
URL:
http://svn.apache.org/viewvc/labs/agora/src/python/process.py?rev=1036246&r1=1036245&r2=1036246&view=diff
==============================================================================
--- labs/agora/src/python/process.py (original)
+++ labs/agora/src/python/process.py Wed Nov 17 22:02:29 2010
@@ -25,7 +25,7 @@ Where OPTIONS is one or more of:
-h
show usage and exit
-s
- display stats from the history file. These stats describe processing
+ output stats from the history file in CSV format. These stats describe
processing
that has been carried out in the past.
-l LIST
only process the mailing list identified
@@ -267,8 +267,6 @@ def main():
usage(0)
elif opt == "-l":
list = arg
- if loud:
- print "Limit processing to", list
elif opt == "-s":
display_stats()
sys.exit(0)
@@ -312,34 +310,29 @@ def main():
def display_stats():
global list
+ print "Date, Total emails, Not in reply-to"
+
history = load_history()
for file in history:
- if list is not None:
- if list in file:
- last_modified = history[file][0]
- stats = history[file][1]
- total = int(stats[0])
- valid = stats[1]
- invalid = stats[2]
- error = stats[3]
- missing_date = stats[4]
- missing_address = stats[5]
- missing_msgID = stats[6]
- missing_backlink = int(stats[7])
- with_backlink = total - missing_backlink
- in_conversation = round(float(with_backlink) / float (total) *
100, 1)
-
- start = file.index(list) + len(list) + 1
- if file[-3:] == '.gz':
- end = len(file) - 3
- else:
- end = len(file)
-
- print file[start:end]
- print "Total emails", total
- print "Not in reply-to", missing_backlink
- print "% in conversation", in_conversation
- print
+ if list is not None and list in file:
+ last_modified = history[file][0]
+ stats = history[file][1]
+ total = int(stats[0])
+ valid = stats[1]
+ invalid = stats[2]
+ error = stats[3]
+ missing_date = stats[4]
+ missing_address = stats[5]
+ missing_msgID = stats[6]
+ missing_backlink = int(stats[7])
+
+ start = file.index(list) + len(list) + 1
+ if file[-3:] == '.gz':
+ end = len(file) - 3
+ else:
+ end = len(file)
+
+ print file[start:end], ",", total, ",", missing_backlink
#-----------------------------------------------------------------------#
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]