Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(290)

Unified Diff: tools/playback_benchmark/run.py

Issue 1515006: Playback benchmark scripts. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 10 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/playback_benchmark/proxy_handler.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/playback_benchmark/run.py
===================================================================
--- tools/playback_benchmark/run.py (revision 0)
+++ tools/playback_benchmark/run.py (revision 0)
@@ -0,0 +1,39 @@
+#!/usr/bin/env python
+#
+# Copyright 2010 Google Inc. All Rights Reserved.
+
+"""Script for test playback.
+
+Prerequisites:
+1. OpenSSL library - http://www.openssl.org/
+2. Python interface to the OpenSSL library - https://launchpad.net/pyopenssl
+
+Example usage:
+python run.py -t <test_dir>
+"""
+
+from optparse import OptionParser
+
+import playback_driver
+import proxy_handler
+
+
+def Run(options):
+ driver = playback_driver.PlaybackRequestHandler(options.test_dir)
+ httpd = proxy_handler.CreateServer(driver, options.port)
+ sa = httpd.socket.getsockname()
+ print "Serving HTTP on", sa[0], "port", sa[1], "..."
+ httpd.serve_forever()
+
+
+if __name__ == '__main__':
+ parser = OptionParser()
+ parser.add_option("-t", "--test-dir", dest="test_dir",
+ help="directory containing recorded test data")
+ parser.add_option("-p", "--port", dest="port", type="int", default=8000)
+ options = parser.parse_args()[0]
+ if not options.test_dir:
+ raise Exception('please specify test directory')
+
+ Run(options)
+
« no previous file with comments | « tools/playback_benchmark/proxy_handler.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698