summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--reports.py50
1 files changed, 50 insertions, 0 deletions
diff --git a/reports.py b/reports.py
index 1c707d0..930ccb6 100644
--- a/reports.py
+++ b/reports.py
@@ -214,6 +214,54 @@ def ReportByRevs(hlist):
EndReport()
#
+# Reviews-received reporting
+#
+def ReviewsReceived(h):
+ recv = 0
+ for p in h.patches:
+ recv += len(p.reviews)
+ return recv
+
+def CompareRevsReceived(h1, h2):
+ return ReviewsReceived(h2) - ReviewsReceived(h1)
+
+def ReportByReviewsReceived(hlist):
+ hlist.sort(CompareRevsReceived)
+ totalrevs = 0
+ for h in hlist:
+ totalrevs += ReviewsReceived(h)
+ count = 0
+ BeginReport('Developers who received the most reviews (total %d)' % totalrevs)
+ for h in hlist:
+ scount = ReviewsReceived(h)
+ if scount > 0:
+ ReportLine(h.name, scount, (scount*100.0)/totalrevs)
+ count += 1
+ if count >= ListCount:
+ break
+ EndReport()
+
+# Revs Given / Revs Received
+def RevGivenOverRecv(h):
+ recv = ReviewsReceived(h)
+ if recv == 0:
+ return 31337
+ return float(len(h.reviews)) / float(recv)
+
+def ReportByRevFlux(hlist):
+ hlist.sort(lambda h1, h2 : int(1000.0 * (RevGivenOverRecv(h2) - RevGivenOverRecv(h1))))
+ count = 0
+ BeginReport('Review Flux: Reviews Given / Reviews Received')
+ for h in hlist:
+ recvd = ReviewsReceived(h)
+ if recvd > 0:
+ ReportLineStr(h.name, 1, "({:4d} / {:4d} = {:<4.2f})".format(len(h.reviews), recvd, RevGivenOverRecv(h)))
+ count += 1
+ if count >= ListCount:
+ break
+ EndReport()
+
+#
# tester reporting.
#
def CompareTests(h1, h2):
@@ -369,6 +417,8 @@ def DevReports(hlist, totalchanged, cscount, totalremoved):
ReportByLRemoved(hlist, totalremoved)
ReportBySOBs(hlist)
ReportByRevs(hlist)
+ ReportByReviewsReceived(hlist)
+ ReportByRevFlux(hlist)
ReportByTests(hlist)
ReportByTestCreds(hlist)
ReportByReports(hlist)