def run_test_series(db, seq): """ This script takes a sequence of threshold values and executes tests """ dir_name = initialize(clients, db) the_time = base_time(tz = tz) for (wl, t) in seq: t = t if t > 0 else None # submit the task submit_workload(clients, dir_name, db, wl, the_time, t) print green("submitted on %s with threshold = %s" % (the_time, t)) if LOCAL: the_time += timedelta(minutes = 1) else: the_time += delay(wl, t) the_time = base_time(the_time, tz = tz) # round the time up # end of all disconnect_all()
def run_test_series(db, seq): """ This script takes a sequence of threshold values and executes tests """ dir_name = initialize(clients, db) the_time = base_time(tz=tz) for (wl, t) in seq: t = t if t > 0 else None # submit the task submit_workload(clients, dir_name, db, wl, the_time, t) print green("submitted on %s with threshold = %s" % (the_time, t)) if LOCAL: the_time += timedelta(minutes=1) else: the_time += delay(wl, t) the_time = base_time(the_time, tz=tz) # round the time up # end of all disconnect_all()
def load(db, target=None): """Starts loading of data to the database""" timestamp = base_time() print green(timestamp, bold = True) clientno = _client_no() database = get_db(db) with cd(database['home']): if target is not None: part = int(target) / len(env.roledefs['client']) run(_at(_ycsbloadcmd(database, clientno, timestamp, part), timestamp)) else: run(_at(_ycsbloadcmd(database, clientno, timestamp), timestamp))
def run_workload(db, workload, target=None): """Starts running of the workload""" timestamp = base_time() print green(timestamp, bold = True) database = get_db(db) load = get_workload(workload) with cd(database['home']): if target is not None: part = int(target) / len(env.roledefs['client']) run(_at(_ycsbruncmd(database, load, timestamp, part), timestamp)) else: run(_at(_ycsbruncmd(database, load, timestamp), timestamp))
def run_workload(db, workload, target=None): """Starts running of the workload""" timestamp = base_time() print green(timestamp, bold=True) database = get_db(db) load = get_workload(workload) with cd(database['home']): if target is not None: part = int(target) / len(env.roledefs['client']) run(_at(_ycsbruncmd(database, load, timestamp, part), timestamp)) else: run(_at(_ycsbruncmd(database, load, timestamp), timestamp))
def delay_after(self): """ Returns estimated delay (run time) for the test with parameter t. In seconds """ opc = workloads.data['operationcount'] # redefine operation count if the workload hath workload = get_workload(self.wl) if 'properties' in workload: if 'operationcount' in workload['properties']: opc = long(workload['properties']['operationcount']) t = opc if self.thr is None else self.thr d = int((opc / t) * 1.1) the_time = self.time + timedelta(seconds=d) the_time = base_time(the_time, tz=self.tz) # round the time up return the_time - self.time
def delay_after(self): """ Returns estimated delay (run time) for the test with parameter t. In seconds """ opc = workloads.data['operationcount'] # redefine operation count if the workload hath workload = get_workload(self.wl) if 'properties' in workload: if 'operationcount' in workload['properties']: opc = long(workload['properties']['operationcount']) t = opc if self.thr is None else self.thr d = int((opc / t) * 1.1) the_time = self.time + timedelta(seconds = d) the_time = base_time(the_time, tz = self.tz) # round the time up return the_time - self.time
def load(db, target=None): """Starts loading of data to the database""" timestamp = base_time() print green(timestamp, bold=True) clientno = _client_no() database = get_db(db) with cd(database['home']): if target is not None: part = int(target) / len(env.roledefs['client']) run( _at(_ycsbloadcmd(database, clientno, timestamp, part), timestamp)) else: run(_at(_ycsbloadcmd(database, clientno, timestamp), timestamp))
def __init__(self, the_db, the_tz=hosts.timezone): self.dir_name = initialize(clients, the_db) self.base_time = base_time(tz=the_tz) initialize_servers(the_db) self.tz = the_tz self.seq = []
def __init__(self, the_db, the_tz = hosts.timezone): self.dir_name = initialize(clients, the_db) self.base_time = base_time(tz = the_tz) initialize_servers(the_db) self.tz = the_tz self.seq = []