Add bugzilla query time

This commit is contained in:
Jason Tibbitts 2012-06-12 16:32:02 -05:00
parent 81508c9bd5
commit 059144a9ac
2 changed files with 6 additions and 2 deletions

View file

@ -1,5 +1,5 @@
#!/usr/bin/python -t #!/usr/bin/python -t
VERSION = "2.5" VERSION = "2.6"
# $Id: review-stats.py,v 1.12 2010/01/15 05:14:10 tibbs Exp $ # $Id: review-stats.py,v 1.12 2010/01/15 05:14:10 tibbs Exp $
# Note: This script presently lives in internal git and external cvs. External # Note: This script presently lives in internal git and external cvs. External
@ -21,6 +21,7 @@ import os
import string import string
import sys import sys
import tempfile import tempfile
import time
from copy import deepcopy from copy import deepcopy
from genshi.template import TemplateLoader from genshi.template import TemplateLoader
from optparse import OptionParser from optparse import OptionParser
@ -370,7 +371,9 @@ def report_new(bugs, bugdata, loader, tmpdir, subs):
if __name__ == '__main__': if __name__ == '__main__':
options = parse_commandline() options = parse_commandline()
bz = bugzilla.Bugzilla(url=options.url, cookiefile=None) bz = bugzilla.Bugzilla(url=options.url, cookiefile=None)
t = time.time()
(bugs, bugdata) = run_query(bz) (bugs, bugdata) = run_query(bz)
querytime = time.time() - t
# Don't bother running this stuff until the query completes, since it fails # Don't bother running this stuff until the query completes, since it fails
# so often. # so often.
@ -380,6 +383,7 @@ if __name__ == '__main__':
# The initial set of substitutions that's shared between the report functions # The initial set of substitutions that's shared between the report functions
subs = { subs = {
'update': datetime.datetime.now().strftime('%Y-%m-%d %H:%M'), 'update': datetime.datetime.now().strftime('%Y-%m-%d %H:%M'),
'querytime': querytime,
'version': VERSION, 'version': VERSION,
'count': 0, 'count': 0,
'months': [], 'months': [],

View file

@ -44,7 +44,7 @@ available:
<tr><td style="white-space: nowrap"><a href="HIDDEN.html">Hidden tickets</a> ($hidden)</td> <tr><td style="white-space: nowrap"><a href="HIDDEN.html">Hidden tickets</a> ($hidden)</td>
<td>Tickets which have been hidden for some reason. These tickets either depend on other review tickets which have not yet been closed, or are unreviewable for some reason. See <a href="https://fedoraproject.org/wiki/Package_Review_Process#Special_blocker_tickets">this page</a> for more information on the various states a review ticket can have.</td></tr> <td>Tickets which have been hidden for some reason. These tickets either depend on other review tickets which have not yet been closed, or are unreviewable for some reason. See <a href="https://fedoraproject.org/wiki/Package_Review_Process#Special_blocker_tickets">this page</a> for more information on the various states a review ticket can have.</td></tr>
</table> </table>
Last updated: ${update}, version ${version}. Last updated: ${update}, query time: ${'{:0.3f}'.format(querytime)}, version: ${version}.
<br/> <br/>
<h2>Quick Review Search</h2> <h2>Quick Review Search</h2>
<form name="queryform" action="http://bugzilla.redhat.com/buglist.cgi" method="get" <form name="queryform" action="http://bugzilla.redhat.com/buglist.cgi" method="get"