コード例 #1
0
ファイル: failover.py プロジェクト: EnigmaCurry/YCSB
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()
コード例 #2
0
ファイル: failover.py プロジェクト: wmarquardt/ycsb-thumbtack
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()
コード例 #3
0
ファイル: ycsb.py プロジェクト: aerospike/ycsb-thumbtack
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))
コード例 #4
0
ファイル: ycsb.py プロジェクト: EnigmaCurry/YCSB
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))
コード例 #5
0
ファイル: ycsb.py プロジェクト: yife/ycsb
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))
コード例 #6
0
ファイル: failover.py プロジェクト: wmarquardt/ycsb-thumbtack
 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
コード例 #7
0
ファイル: failover.py プロジェクト: EnigmaCurry/YCSB
 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
コード例 #8
0
ファイル: ycsb.py プロジェクト: yife/ycsb
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))
コード例 #9
0
ファイル: failover.py プロジェクト: wmarquardt/ycsb-thumbtack
 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 = []
コード例 #10
0
ファイル: failover.py プロジェクト: EnigmaCurry/YCSB
 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 = []