Commits

Anonymous committed 81f8a9e

Optional profiling added

Comments (0)

Files changed (1)

     parser.add_option('-v', '--verbose', dest='verbose',
             action='store_true', default=False,
             help="show traceback infomation if a test fails")
+
+    parser.add_option('-p', '--profile', dest='profile',
+            action='store_true', default=False,
+            help="store profiling log for every test")
+            
     global options
     options, args = parser.parse_args()
 
     global total_time
     total_time = 0
 
+    
     print "Benchmarking %s..." % module_name
+    
+    if options.profile:
+        import hotshot
+        prof = hotshot.Profile("%s.prof" % name)
+        prof.start()
+        
     Benchmark(module, options)
 
+    if options.profile:
+        prof.stop()
+        prof.close()
+
     print "Total_time is %f" % total_time
     print '---'
 
         ('handlersocket', handlersocket)
     ]
 
+
     for name, module in modules:
         main(name, module)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.