[rhmessaging-commits] rhmessaging commits: r1752 - mgmt/cumin/bin.
rhmessaging-commits at lists.jboss.org
rhmessaging-commits at lists.jboss.org
Mon Mar 3 12:28:57 EST 2008
Author: justi9
Date: 2008-03-03 12:28:57 -0500 (Mon, 03 Mar 2008)
New Revision: 1752
Modified:
mgmt/cumin/bin/cumin-bench
Log:
cli improvements to cumin-bench like those done for cumin and cumin-test
Modified: mgmt/cumin/bin/cumin-bench
===================================================================
--- mgmt/cumin/bin/cumin-bench 2008-03-03 17:26:37 UTC (rev 1751)
+++ mgmt/cumin/bin/cumin-bench 2008-03-03 17:28:57 UTC (rev 1752)
@@ -18,8 +18,8 @@
--profile"""
sys.exit(1)
-def do_main(home, data, hits):
- app = Cumin(home, data)
+def do_main(home, data, spec, hits):
+ app = Cumin(home, data, spec)
app.enable_debug()
@@ -44,13 +44,14 @@
if "-h" in sys.argv or "--help" in sys.argv:
usage()
- home = os.environ.get("CUMIN_HOME")
+ home = os.environ.get("CUMIN_HOME", os.path.normpath("/usr/share/cumin"))
+ spec = os.environ.get("AMQP_SPEC",
+ os.path.normpath("/usr/share/amqp/amqp.0-10-preview.xml"))
- if not home:
- home = os.path.normpath("/usr/share/cumin")
-
config = Config()
+ config.add_param("home", "s", home)
config.add_param("data", "s", "postgresql://cumin@localhost/cumin")
+ config.add_param("spec", "s", spec)
config.add_param("hits", "i", 1000)
config.add_param("profile", "b", False)
@@ -60,8 +61,9 @@
config.prt()
- home = os.environ["CUMIN_HOME"]
+ home = config.get("home")
data = config.get("data")
+ spec = config.get("spec")
hits = config.get("hits")
profile = config.get("profile")
@@ -72,7 +74,8 @@
prof = Profile()
try:
- statement = "do_main('%s', '%s', %i)" % (home, data, hits)
+ statement = "do_main('%s', '%s', '%s', %i)" % \
+ (home, data, spec, hits)
prof.run(statement)
@@ -94,7 +97,7 @@
stats.strip_dirs()
else:
- do_main(home, data, hits)
+ do_main(home, data, spec, hits)
if __name__ == "__main__":
main()
More information about the rhmessaging-commits
mailing list