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 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 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)
def inner(): command = _at(prepare_startcmd(database), the_time) run(command, shell=True)
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)
def inner(): with cd(self.dir_name): command = _at(prepare_startcmd(database), the_time) run(command)
#!/usr/bin/python import sys, os sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..')) # ugly hack to allow import from the root from fabfile.helpers import _at from conf.databases import databases print _at(databases['couchbase2']['failover']['kill_command']); print _at(databases['couchbase2']['failover']['start_command']);