@@ -34,7 +34,7 @@ def cleanup():
34
34
peloton_proc .kill ()
35
35
call ("rm -rf %s" % (OLTP_HOME ), shell = True )
36
36
37
- def config_xml_file (host , port , benchmark , transaction , scalefactor ,terminals ,time ,weights ):
37
+ def config_xml_file (host , port , benchmark , transaction , scalefactor , terminals , time , weights , upload_url , upload_code ):
38
38
xml = ElementTree .parse ("%ssample_" % (CONFIG_FILES_HOME )+ benchmark + "_config.xml" )
39
39
root = xml .getroot ()
40
40
root .find ("dbtype" ).text = "peloton"
@@ -45,6 +45,8 @@ def config_xml_file(host, port, benchmark, transaction, scalefactor,terminals,ti
45
45
root .find ("isolation" ).text = str (transaction )
46
46
root .find ("scalefactor" ).text = str (scalefactor )
47
47
root .find ("terminals" ).text = str (terminals )
48
+ root .find ("uploadCode" ).text = str (upload_code )
49
+ root .find ("uploadUrl" ).text = str (upload_url )
48
50
for work in root .find ('works' ).findall ('work' ):
49
51
work .find ('time' ).text = str (time )
50
52
work .find ('rate' ).text = "unlimited"
@@ -87,6 +89,10 @@ def collect_data(result_dir_name, weights, scalefactor):
87
89
aparser .add_argument ('db-port' , type = int , help = 'DB Port' )
88
90
aparser .add_argument ('benchmark' , help = 'Benchmark Type' )
89
91
aparser .add_argument ('weights' , help = "Benchmark weights" )
92
+ aparser .add_argument ('--upload-code' , type = str , \
93
+ help = 'Upload code.' )
94
+ aparser .add_argument ('--upload-url' , type = str , \
95
+ help = 'Upload url. (default: https://oltpbench.cs.cmu.edu/new_result/)' )
90
96
aparser .add_argument ('--scale-factor' , type = int , metavar = 'S' , \
91
97
help = 'The scale factor. (default: 1)' )
92
98
aparser .add_argument ('--transaction-isolation' , metavar = 'I' , \
@@ -109,24 +115,33 @@ def collect_data(result_dir_name, weights, scalefactor):
109
115
scalefactor = 1
110
116
transaction_isolation = "TRANSACTION_SERIALIZABLE"
111
117
terminals = 1
112
- if ("client-time" in args and args ["client-time" ]):
113
- time = int (args ["client-time" ])
118
+ upload_code = ''
119
+ upload_url = r'https://oltpbench.cs.cmu.edu/new_result/'
120
+
121
+ if ("upload_code" in args and args ["upload_code" ]):
122
+ upload_code = str (args ["upload_code" ])
123
+
124
+ if ("upload_url" in args and args ["upload_url" ]):
125
+ upload_url = str (args ["upload_url" ])
126
+
127
+ if ("client_time" in args and args ["client_time" ]):
128
+ time = int (args ["client_time" ])
114
129
115
- if ("scale-factor " in args and args ["scale-factor " ]):
116
- scalefactor = int (args ["scale-factor " ])
130
+ if ("scale_factor " in args and args ["scale_factor " ]):
131
+ scalefactor = int (args ["scale_factor " ])
117
132
118
133
if ("terminals" in args and args ["terminals" ]):
119
134
terminals = int (args ["terminals" ])
120
135
121
- if ("transaction-isolation " in args and args ["transaction-isolation " ]):
122
- transaction_isolation = str (args ["transaction-isolation " ])
136
+ if ("transaction_isolation " in args and args ["transaction_isolation " ]):
137
+ transaction_isolation = str (args ["transaction_isolation " ])
123
138
124
139
run_peloton ()
125
140
gather_oltpbench ()
126
141
## ----------------------------------------------
127
142
## EXECUTE
128
143
## ----------------------------------------------
129
- config_xml_file (db_host , db_port , benchmark , transaction_isolation , scalefactor , terminals , time , weights )
144
+ config_xml_file (db_host , db_port , benchmark , transaction_isolation , scalefactor , terminals , time , weights , upload_url , upload_code )
130
145
start_bench (benchmark , weights ,scalefactor )
131
146
result_dir_name = "tpcc_collected_data_" + weights .replace ("," ,"_" )+ "_" + str (scalefactor )
132
147
collect_data (result_dir_name ,weights ,scalefactor )
0 commit comments