diff options
author | Kenneth Graunke <kenneth@whitecape.org> | 2015-07-17 12:28:08 -0700 |
---|---|---|
committer | Kenneth Graunke <kenneth@whitecape.org> | 2015-07-17 12:30:58 -0700 |
commit | a30283b04b6949e362ad5757d97c1c15d568a143 (patch) | |
tree | 836d19b5eab31c8ad87a731c30b53ef6ec71df0b | |
parent | 5516be6e392b210a32d95f61cda0f50a8bcf5be4 (diff) |
-rw-r--r-- | reports.py | 50 |
1 files changed, 50 insertions, 0 deletions
@@ -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) |