Ejemplo n.º 1
0
def run_sync_kv_latency_benchmark(d_host,
                                  d_port,
                                  l_port,
                                  data_path,
                                  workload_path,
                                  workload_off=0,
                                  n_ops=100000):
    client = JiffyClient(d_host, d_port, l_port)
    kv = client.open(data_path)
    workload = make_workload(workload_path, workload_off, n_ops, kv)

    ops = 0
    while ops < len(workload):
        begin = time.time()
        workload[ops][0](*workload[ops][1])
        tot = time.time() - begin
        print("%f" % (tot * 1e6))
        ops += 1
Ejemplo n.º 2
0
def load_and_run_workload(barrier, workload_path, workload_off, d_host, d_port,
                          l_port, data_path, n_ops):
    client = JiffyClient(d_host, d_port, l_port)
    kv = client.open(data_path)
    workload = make_workload(workload_path, workload_off, n_ops, kv)
    logging.info("[Process] Loaded data for process.")

    barrier.wait()
    logging.info("[Process] Starting benchmark...")

    ops = 0
    begin = time.time()
    while ops < len(workload):
        workload[ops][0](*workload[ops][1])
        ops += 1
    end = time.time()

    print(float(ops) / (end - begin))