lists.arthurdejong.org
RSS feed

webcheck commit: r429 - webcheck

[Date Prev][Date Next] [Thread Prev][Thread Next]

webcheck commit: r429 - webcheck



Author: arthur
Date: Fri Aug 19 21:28:54 2011
New Revision: 429
URL: http://arthurdejong.org/viewvc/webcheck?view=rev&revision=429

Log:
use sqltap to save profiling information from sqlalchemy if the module is 
available and we're profiling

Modified:
   webcheck/webcheck.py

Modified: webcheck/webcheck.py
==============================================================================
--- webcheck/webcheck.py        Fri Aug 19 21:08:47 2011        (r428)
+++ webcheck/webcheck.py        Fri Aug 19 21:28:54 2011        (r429)
@@ -279,7 +279,15 @@
                 import cProfile
             except ImportError:
                 import profile as cProfile
+            try:
+                import sqltap
+                sqltap.start()
+            except ImportError:
+                pass
             cProfile.run('main(site)', fname)
+            if 'sqltap' in locals():
+                statistics = sqltap.collect()
+                sqltap.report(statistics, os.path.join(config.OUTPUT_DIR, 
'sqltap.html'))
         else:
             main(site)
     except KeyboardInterrupt:
-- 
To unsubscribe send an email to
webcheck-commits-unsubscribe@lists.arthurdejong.org or see
http://lists.arthurdejong.org/webcheck-commits