INNER CODE UNIT · Python
test
bitpoke/mysql-operator · hack/development/stress_test.py:39
def test(self, epoch):
pass
class InsertStress(Base):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.table_name = 'test'
def init_sql(self):
cursor = self.db.cursor()
cursor.execute('CREATE TABLE IF NOT EXISTS {} '
'(f1 VARCHAR(30), f2 VARCHAR(30), f3 VARCHAR(30))'.format(self.table_name))
self.db.commit()
def test(self, epoch):
sql = "INSERT INTO {} (f1, f2, f3) VALUES (%s, %s, %s)".format(self.table_name)
val = []