[Blends-commit] [SCM] website branch, master, updated. 8fb3bc7c5e52d49aa5f2e9344d62f2ac3ef47fa9

Andreas Tille tille at debian.org
Fri Mar 6 10:37:30 UTC 2015


The following commit has been merged in the master branch:
commit 8fb3bc7c5e52d49aa5f2e9344d62f2ac3ef47fa9
Author: Andreas Tille <tille at debian.org>
Date:   Fri Mar 6 11:36:07 2015 +0100

    The query query_bug_packages has a timing problem - at least for debian.edu it becomes inacceptably long.  Report the timing as a first means if larger than a limit (currently 30 seconds)

diff --git a/webtools/bugs_udd.py b/webtools/bugs_udd.py
index 40efda0..69fe254 100755
--- a/webtools/bugs_udd.py
+++ b/webtools/bugs_udd.py
@@ -7,6 +7,8 @@ UDDPORT=5452
 PORT=UDDPORT
 DEFAULTPORT=5432
 
+SLOWQUERYREPORTLIMIT=30
+
 debug=0
 
 from sys import argv, stderr, exit
@@ -51,7 +53,11 @@ curs = conn.cursor()
 
 def _execute_udd_query(query):
     try:
+        t = time.time()
         curs.execute(query)
+        elapsed_time = time.time() - t
+        if elapsed_time > SLOWQUERYREPORTLIMIT: # report what query took longer than SLOWQUERYREPORTLIMIT seconds
+            print "Time: %s\nQuery: %s" % (str(elapsed_time), query)
     except psycopg2.ProgrammingError, err:
         print >>stderr, "Problem with query\n%s" % (query)
         print >>stderr, err

-- 
Static and dynamic websites for Debian Pure Blends



More information about the Blends-commit mailing list