@@ -149,8 +149,7 @@ def drop_all_columns(self, table_name):
149
149
if c .name != "id" :
150
150
self .drop_column (table_name , c .name )
151
151
152
- def queries_while_alter (self ):
153
- table_name = "queries_while_alter"
152
+ def queries_while_alter (self , table_name ):
154
153
155
154
schema = self .list_columns (table_name )
156
155
@@ -174,14 +173,11 @@ def run(self):
174
173
175
174
while time .time () - started_at < self .duration :
176
175
try :
177
- self .create_table ("queries_while_alter" )
178
-
176
+ # TODO: drop only created tables by current workload
179
177
self .drop_all_tables ()
180
-
181
- self .queries_while_alter ()
182
-
183
178
table_name = table_name_with_timestamp ()
184
179
self .create_table (table_name )
180
+ self .queries_while_alter (table_name )
185
181
except Exception as e :
186
182
print (type (e ), e )
187
183
@@ -192,7 +188,7 @@ def run(self):
192
188
)
193
189
parser .add_argument ('--endpoint' , default = 'localhost:2135' , help = "An endpoint to be used" )
194
190
parser .add_argument ('--database' , default = None , required = True , help = 'A database to connect' )
195
- parser .add_argument ('--duration' , default = 120 , type = lambda x : int (x ), help = 'A duration of workload in seconds.' )
191
+ parser .add_argument ('--duration' , default = 10 ** 9 , type = lambda x : int (x ), help = 'A duration of workload in seconds.' )
196
192
parser .add_argument ('--batch_size' , default = 1000 , help = 'Batch size for bulk insert' )
197
193
args = parser .parse_args ()
198
194
with Workload (args .endpoint , args .database , args .duration , args .batch_size ) as workload :
0 commit comments