Merge lp:~kalebral-deactivatedaccount/drizzle-automation/dbt2-script-changes into lp:drizzle-automation

Proposed by Lee Bieber
Status: Merged
Merged at revision: not available
Proposed branch: lp:~kalebral-deactivatedaccount/drizzle-automation/dbt2-script-changes
Merge into: lp:drizzle-automation
Diff against target: 93 lines (+20/-20)
1 file modified
drizzle/automation/dbt2/run.py (+20/-20)
To merge this branch: bzr merge lp:~kalebral-deactivatedaccount/drizzle-automation/dbt2-script-changes
Reviewer Review Type Date Requested Status
Jay Pipes Approve
Review via email: mp+17699@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Lee Bieber (kalebral-deactivatedaccount) wrote :

changes necessary to get dbt2 benchmark to run with the latest dbt2 scripts

Revision history for this message
Jay Pipes (jaypipes) wrote :

Cool.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'drizzle/automation/dbt2/run.py'
2--- drizzle/automation/dbt2/run.py 2010-01-07 20:48:08 +0000
3+++ drizzle/automation/dbt2/run.py 2010-01-19 23:49:11 +0000
4@@ -76,6 +76,12 @@
5 db.execute_sql(sql)
6 fileHandle.close()
7
8+# location where test results are stored, dbt2 expects it to not exist
9+def remove_directory(output_dirname):
10+ if os.path.exists(output_dirname):
11+ logging.info("Removing %s" % output_dirname)
12+ import shutil
13+ shutil.rmtree(output_dirname)
14
15 def execute(processing_mode, variables):
16 # Set/verify some required variables, depending on the server we are benchmarking.
17@@ -144,14 +150,6 @@
18 # clean data directory (var)
19 server.clear()
20
21- # Start up the server...
22- server.start()
23-
24- # create test database
25- if not util.drop_and_create_test_database(client):
26- server.stop()
27- sys.exit(1)
28-
29 # If we are profiling, we must now stop and restart the server
30 # under the profiler now that the database is prepared
31 util.get_profile_options(server,variables['profiler'])
32@@ -164,39 +162,41 @@
33
34 # location of dbt2 tools and scripts
35 dbt2_home= dbt2_config_variables['run']['dbt2_home']
36+
37 bzr_revision= variables['bzr_revision']
38 test_time= dbt2_config_variables['run']['dbt2_time']
39 warehouses= dbt2_config_variables['run']['dbt2_warehouses']
40
41- # location where test results are stored
42- output_dirname= ('dbt2-%s' % (bzr_revision))
43- if not os.path.isdir(output_dirname):
44- logging.info("Creating %s" % output_dirname)
45- os.mkdir(output_dirname)
46-
47 # load data into database
48+ server.start()
49 cmd= "%s/bin/drizzle/dbt2-drizzle-load-db --path %s --verbose --drizzle_path %s" % (dbt2_home, dbt2_config_variables['run']['dbt2_data_dir'], os.path.join(working_dir, 'client/drizzle'))
50- logging.info("Loading data.... ")
51- logging.info("%s " % cmd)
52+ logging.info("Loading data.... %s " % cmd)
53 (retcode, output)= commands.getstatusoutput(cmd)
54 if not retcode == 0:
55 logging.info("Failed to load data\n%s" % output)
56 sys.exit(1)
57+ server.stop()
58
59 # get list of connections to run with
60 connection_levels= [int(x) for x in dbt2_config_variables['run']['dbt2_connections'].split(",")]
61
62+ # need to set the path so we can find the dbt2 scripts
63+ temp_env= os.environ["PATH"]
64+ os.environ["PATH"] = "%s:%s/bin" % (temp_env, dbt2_home)
65+ logging.info("Setting PATH environment variable to %s" % os.environ["PATH"])
66+
67 # run the tests
68+ # Note that the tests start and stop drizzled after each run
69 for connections in connection_levels:
70- cmd= "%s/bin/drizzle/dbt2-drizzle-run --connections %d --time %d --warehouses %d --verbose --output-base %s --run-number %s" % (dbt2_home, connections, int(test_time), int(warehouses), output_dirname, connections)
71+ output_dirname= "results-%s/%s" % (bzr_revision, connections)
72+ remove_directory(output_dirname)
73+ cmd= "%s/bin/dbt2-run-workload -a drizzle -c %d -d %d -w %d -o %s -i %s -l %d -b 40" % (dbt2_home, connections, int(test_time), int(warehouses), output_dirname, working_dir, server.getPort())
74 logging.info("Running %s " % cmd)
75 (retcode, output)= commands.getstatusoutput(cmd)
76 if not retcode == 0:
77 logging.info("Failed to run test with %d connections\n%s" % (connections,output))
78 sys.exit(1)
79
80- server.stop()
81-
82 if variables['no_store_db'] is False:
83
84 util.log_sysbench_run(run_id, config_id, server_name, server_version, run_date)
85@@ -204,7 +204,7 @@
86 # We now log the results of this run -
87 logging.info("Logging dbt2 revision %s results to database for run %d" % (bzr_revision, run_id))
88 for connections in connection_levels:
89- stat_file= ("%s/%s/output/%d/driver/statistics.log" % (working_dir, output_dirname, connections))
90+ stat_file= ("%s/results-%s/%s/report.txt" % (working_dir, bzr_revision, connections))
91 log_dbt2_iteration(run_id, connections, test_time, warehouses, stat_file)
92
93 # send email report

Subscribers

People subscribed via source and target branches

to all changes: