Author: justi9
Date: 2007-10-12 22:49:17 -0400 (Fri, 12 Oct 2007)
New Revision: 1038
Modified:
mgmt/cumin/bin/cumin-test
mgmt/cumin/python/wooly/devel.py
Log:
Small profiling and benchmarking changes.
Modified: mgmt/cumin/bin/cumin-test
===================================================================
--- mgmt/cumin/bin/cumin-test 2007-10-13 02:04:26 UTC (rev 1037)
+++ mgmt/cumin/bin/cumin-test 2007-10-13 02:49:17 UTC (rev 1038)
@@ -1,6 +1,7 @@
#!/usr/bin/env python
import sys, profile, pstats
+from time import time
from wooly.devel import BenchmarkHarness
from wooly.server import WebServer
@@ -42,21 +43,21 @@
server = WebServer(app, port)
server.run()
-def main(sargs):
- args = load_args(sargs)
+def main():
+ args = load_args(sys.argv)
in_port = int(args.get("port", 9090))
- in_debug = True
in_profile = "profile" in args
+ in_debug = "no-debug" not in args
in_bench = "bench" in args
in_demodata = "no-demo-data" not in args
- stats_file = "/tmp/cumin-test-stats"
+ stats_file = "/tmp/cumin-test-stats-%i" % time()
if in_profile:
try:
code = "do_main(%i, %r, %r, %r)" % \
- (in_port, False, in_bench, in_demodata)
+ (in_port, in_debug, in_bench, in_demodata)
profile.run(code, stats_file)
raise KeyboardInterrupt()
except KeyboardInterrupt:
@@ -73,4 +74,4 @@
pass
if __name__ == "__main__":
- main(sys.argv)
+ main()
Modified: mgmt/cumin/python/wooly/devel.py
===================================================================
--- mgmt/cumin/python/wooly/devel.py 2007-10-13 02:04:26 UTC (rev 1037)
+++ mgmt/cumin/python/wooly/devel.py 2007-10-13 02:49:17 UTC (rev 1038)
@@ -14,13 +14,11 @@
count = 0
while True:
- try:
- url = self.app.debug.urls.pop()
- except KeyError:
- return
+ for url in self.app.debug.urls:
+ if url not in visited:
+ visited.add(url)
+ break
- visited.add(url)
-
start = clock()
session = Session(self.app)