def delay(wl, t): """ 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(wl) if 'properties' in workload: if 'operationcount' in workload['properties']: opc = long(workload['properties']['operationcount']) t = opc if t is None else t d = int((opc / t) * 1.1) return timedelta(seconds = d)
def delay(wl, t): """ 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(wl) if 'properties' in workload: if 'operationcount' in workload['properties']: opc = long(workload['properties']['operationcount']) t = opc if t is None else t d = int((opc / t) * 1.1) return timedelta(seconds=d)
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 submit_workload(the_hosts, dir_name, db, workload, the_time, target = None): """ Schedules the workload. Note: we cannot use ycsb.workload, because it is decorated """ database = get_db(db) load = get_workload(workload) def inner_submit_workload(): with cd(dir_name): param = int(target) / len(the_hosts) if target is not None else None # command = prepare_ycsbruncmd(database, load, the_time, param) command = _at(prepare_ycsbruncmd(the_hosts, dir_name, database, load, the_time, param), the_time) run(command) with almost_nothing(): tasks.execute(inner_submit_workload, hosts=the_hosts)
def submit_workload(the_hosts, dir_name, db, workload, the_time, target=None): """ Schedules the workload. Note: we cannot use ycsb.workload, because it is decorated """ database = get_db(db) load = get_workload(workload) def inner_submit_workload(): with cd(dir_name): param = int(target) / len( the_hosts) if target is not None else None # command = prepare_ycsbruncmd(database, load, the_time, param) command = _at( prepare_ycsbruncmd(the_hosts, dir_name, database, load, the_time, param), the_time) run(command) with almost_nothing(): tasks.execute(inner_submit_workload, hosts=the_hosts)