def main(): hostname = "" if len(sys.argv) <= 1 else sys.argv[1] iter_count = "" if len(sys.argv) <= 2 else sys.argv[2] if not iter_count: print "Usage: db_bench.py hostname iter_count" sys.exit(1) for iteration in range(int(iter_count)): success = True error_mesg = "" brs = [] try: for cfg in configs: out = framework.run_cmd("./db_bench -statistics %s" % (cfg.flags(),)) benches = parse_out(out) name = "unlimited" if "rate_limiter_type" in cfg.config: name = "generic-bps-{rate_limiter_bytes_per_sec}".format(**cfg.config) if cfg.config["rate_limiter_type"] == "Smart": name = "smart-r-{db_get_99}".format(**cfg.config) brs.append(framework.BenchRun(name=name, config=cfg, bench=benches)) except: success = False error_mesg = "".join(traceback.format_exception(*sys.exc_info())) result_json = framework.make_result_json(brs, success=success, error=error_mesg) framework.upload_result_to_gist("db_bench", result_json, iteration=iteration, hostname=hostname)
def main(): brs = [] for cfg in configs: out = framework.run_cmd("./cache_bench %s" % (cfg.flags(),)) print '#######################' print out benches = parse_out(out, _parse_desc) name = "cache {cache_size}".format(**cfg.config) brs.append(framework.BenchRun(name=name, config=cfg, bench=benches)) framework.visualize_diff("cache_bench.pdf", brs)