bodhi/tools/log_stats.py | 8 ++++++++
bodhi/tools/metrics.py | 33 ++++++++++++++++++++++++++-------
2 files changed, 34 insertions(+), 7 deletions(-)
New commits:
commit 870391744e74058ee858c9ef6cc538f7ef783132
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue Jun 8 10:30:23 2010 -0400
Track the number of +0's, +1's, and -1's.
diff --git a/bodhi/tools/metrics.py b/bodhi/tools/metrics.py
index 07e684a..57fe2a2 100755
--- a/bodhi/tools/metrics.py
+++ b/bodhi/tools/metrics.py
@@ -41,6 +41,11 @@ def main():
'occurrences': {},
'accumulative': timedelta(),
'packages': defaultdict(int),
+ # for tracking number of types of karma
+ '1': 0,
+ '0': 0,
+ '-1': 0,
+ None: 0,
}
data = stats[release.name]
@@ -64,16 +69,26 @@ def main():
testingtime_done = False
for comment in update.comments:
- if not feedback_done and (not comment.author.startswith('bodhi')
- and comment.karma != 0 and '@' not in comment.author):
- data['num_feedback'] += 1
- feedback += 1
- feedback_done = True
+
+ data[str(comment.karma)] += 1 # Track the # of +1's, -1's, and
+0's.
+
+ # For figuring out if an update has received feedback or not
+ if not feedback_done:
+ if (not comment.author.startswith('bodhi')
+ and comment.karma != 0
+ and not comment.anonymous):
+ data['num_feedback'] += 1 # per-release tracking of
feedback
+ feedback += 1 # total number of updates that have received
feedback
+ feedback_done = True # so we don't run this for each comment
+
+ # Tracking per-author karma & anonymous feedback
if not comment.author.startswith('bodhi'):
- if comment.anonymous or '@' in comment.author:
+ if comment.anonymous:
+ # @@: should we track anon +0 comments as "feedback"?
if comment.karma != 0:
data['num_anon_feedback'] += 1
else:
+ # strip the group name from the author names
author = comment.author.split('(')[0].strip()
if author not in data['karma']:
data['karma'][author] = 0
@@ -115,6 +130,10 @@ def main():
print " * %d updates received feedback (%0.2f%%)" % (
data['num_feedback'], (float(data['num_feedback']) /
data['num_updates'] * 100))
+ print " * %d +0 comments" % data['0']
+ print " * %d +1 comments" % data['1']
+ print " * %d -1 comments" % data['-1']
+ print " * %d None comments" % data[None]
print " * %d unique authenticated karma submitters" % (
len(data['karma']))
print " * %d anonymous users gave feedback (%0.2f%%)" % (
commit 7e1f181e280b7bef6848b95c56a37aa2fc5ec584
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue Jun 8 10:29:40 2010 -0400
update log_stats.py to show the length of time in testing for updates
that are automatically *unpushed*
diff --git a/bodhi/tools/log_stats.py b/bodhi/tools/log_stats.py
index d8b3109..a2f4fad 100755
--- a/bodhi/tools/log_stats.py
+++ b/bodhi/tools/log_stats.py
@@ -95,6 +95,14 @@ def main():
print " * mode = %d days" % sorted(stable_occur.items(),
key=itemgetter(1))[-1][0]
+ print " * Time spent in testing of updates that were unpushed by
karma:"
+ print " * mean = %d days" % (unstable_accum.days /
len(unstable_deltas))
+ print " * median = %d days" %
unstable_deltas[len(unstable_deltas)/2].days
+ print " * mode = %d days" % sorted(unstable_occur.items(),
+ key=itemgetter(1))[-1][0]
+
+
+
if __name__ == '__main__':
load_config()
commit ef58e8234426624b9b537b22e5bf39f5166710a7
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue May 25 11:44:27 2010 -0400
strip() the username after we remove the admin group
diff --git a/bodhi/tools/metrics.py b/bodhi/tools/metrics.py
index 9968d99..07e684a 100755
--- a/bodhi/tools/metrics.py
+++ b/bodhi/tools/metrics.py
@@ -74,7 +74,7 @@ def main():
if comment.karma != 0:
data['num_anon_feedback'] += 1
else:
- author = comment.author.split('(')[0]
+ author = comment.author.split('(')[0].strip()
if author not in data['karma']:
data['karma'][author] = 0
karma[author] = 0
Show replies by date