def run(server_cmd, port, merge_env=None, origin_cmd=None): # Run deno echo server in the background. if merge_env is None: env = None else: env = os.environ.copy() for key, value in merge_env.iteritems(): env[key] = value # Wait for port 4544 to become available. # TODO Need to use SO_REUSEPORT with tokio::net::TcpListener. time.sleep(5) origin = None if origin_cmd is not None: origin = subprocess.Popen(origin_cmd, env=env) print server_cmd server = subprocess.Popen(server_cmd, env=env) time.sleep(5) # wait for server to wake up. TODO racy. try: cmd = "third_party/wrk/%s/wrk -d %s --latency http://127.0.0.1:%s/" % ( util.platform(), DURATION, port) print cmd output = subprocess.check_output(cmd, shell=True) stats = util.parse_wrk_output(output) print output return stats finally: server.kill() if origin is not None: origin.kill()
def run(server_cmd, merge_env=None): # Run deno echo server in the background. if merge_env is None: env = None else: env = os.environ.copy() for key, value in merge_env.iteritems(): env[key] = value # Wait for port 4544 to become available. # TODO Need to use SO_REUSEPORT with tokio::net::TcpListener. time.sleep(5) server = subprocess.Popen(server_cmd, env=env) time.sleep(5) # wait for server to wake up. TODO racy. try: cmd = "third_party/wrk/%s/wrk -d %s http://%s/" % (util.platform(), DURATION, ADDR) print cmd output = subprocess.check_output(cmd, shell=True) req_per_sec = util.parse_wrk_output(output) print output return req_per_sec finally: server.kill()
def run(server_cmd, merge_env=None): # Run deno echo server in the background. if merge_env is None: env = None else: env = os.environ.copy() for key, value in merge_env.iteritems(): env[key] = value # Wait for port 4544 to become available. # TODO Need to use SO_REUSEPORT with tokio::net::TcpListener. time.sleep(5) server = subprocess.Popen(server_cmd, env=env) time.sleep(5) # wait for server to wake up. TODO racy. try: cmd = "third_party/wrk/%s/wrk -d %s http://%s/" % (util.platform(), DURATION, ADDR) print cmd output = subprocess.check_output(cmd, shell=True) req_per_sec = util.parse_wrk_output(output) print output return req_per_sec finally: server.kill()
def run(server_cmd): # Run deno echo server in the background. server = subprocess.Popen(server_cmd) time.sleep(5) # wait for server to wake up. TODO racy. try: cmd = "third_party/wrk/%s/wrk -d %s http://%s/" % (util.platform(), DURATION, ADDR) print cmd output = subprocess.check_output(cmd, shell=True) req_per_sec = util.parse_wrk_output(output) print output return req_per_sec finally: server.kill()
def qrun(cmd, env=None): run(cmd, quiet=True, env=env) print "clang_format" qrun([clang_format_path, "-i", "-style", "Google"] + find_exts(["libdeno"], [".cc", ".h"])) print "gn format" for fn in ["BUILD.gn", ".gn"] + find_exts(["build_extra", "libdeno"], [".gn", ".gni"]): qrun(["third_party/depot_tools/gn", "format", fn], env=google_env()) print "yapf" qrun([sys.executable, "third_party/python_packages/bin/yapf", "-i"] + find_exts(["tools", "build_extra"], [".py"], skip=["tools/clang"]), env=python_env()) print "prettier" qrun(["node", prettier, "--write", "--loglevel=error"] + ["rollup.config.js"] + glob("*.json") + glob("*.md") + find_exts([".github", "js", "tests", "tools", "website"], [".js", ".json", ".ts", ".md"], skip=["tools/clang"])) print "rustfmt" qrun([ "third_party/rustfmt/" + platform() + "/rustfmt", "--config-path", rustfmt_config, "build.rs" ] + find_exts(["src"], [".rs"]))
run(cmd, quiet=True, env=env) print "clang_format" qrun([clang_format_path, "-i", "-style", "Google"] + find_exts(["libdeno"], [".cc", ".h"])) print "gn format" for fn in ["BUILD.gn", ".gn"] + find_exts(["build_extra", "libdeno"], [".gn", ".gni"]): qrun(["third_party/depot_tools/gn", "format", fn], env=google_env()) print "yapf" qrun( [sys.executable, "third_party/python_packages/bin/yapf", "-i"] + find_exts( ["tools", "build_extra"], [".py"], skip=["tools/clang"]), env=python_env()) print "prettier" qrun(["node", prettier, "--write", "--loglevel=error"] + ["rollup.config.js"] + glob("*.json") + glob("*.md") + find_exts([".github", "js", "tests", "tools", "website", "core"], [".js", ".json", ".ts", ".md"], skip=["tools/clang", "js/deps"])) print "rustfmt" qrun([ "third_party/rustfmt/" + platform() + "/rustfmt", "--config-path", rustfmt_config, "build.rs" ] + find_exts(["src", "core"], [".rs"]))