Commit 6ee0b406 authored by Weixin Deng's avatar Weixin Deng
Browse files

Update goodput sh

parent 1023c4fb
......@@ -27,13 +27,12 @@ def generate_cmd(config: ClientConfig):
return " ".join(cmd)
def run_client(config: ClientConfig):
def run_client(config: ClientConfig, output_dir: str):
print(config)
cmd = generate_cmd(config)
output = subprocess.check_output(
cmd, stderr=subprocess.STDOUT, text=True, shell=True
)
output_dir = pathlib.Path(__file__).resolve().parents[1] / "data"
local_time = datetime.now(pytz.timezone("US/Pacific"))
output_file = f"{output_dir}/{local_time:%y%m%d-%H%M%S}.txt"
with open(output_file, "w") as file:
......@@ -42,10 +41,12 @@ def run_client(config: ClientConfig):
def main():
parser = argparse.ArgumentParser()
parser.add_argument("--output-dir", type=str, required=True)
parser.add_argument("--num-ports-enum", nargs="+", type=int)
parser.add_argument("--num-backends-enum", nargs="+", type=int)
parser.add_argument("--data-size-enum", nargs="+", type=int)
args = parser.parse_args()
output_dir = str(pathlib.Path(__file__).resolve().parents[1] / args.output_dir)
for data_size in args.data_size_enum:
for num_ports in args.num_ports_enum:
......@@ -53,7 +54,7 @@ def main():
config = ClientConfig(
num_ports=num_ports, num_backends=num_backends, data_size=data_size
)
run_client(config)
run_client(config, output_dir)
if __name__ == "__main__":
......
python3 goodput.py \
nohup python3 goodput.py \
--output-dir "data/baseline"
--num-ports-enum 1 2 4 8 16 \
--num-backends-enum 1 2 4 8 \
--data-size-enum 64 128 256 512 1024 2048 4096 8192 16384 32768 65536 131072 262144 524288 1048576
--data-size-enum 64 128 256 512 1024 2048 4096 8192 16384 32768 65536 131072 262144 524288 1048576 \
>/dev/null 2>&1 &
go run ../src/service.go \
-server \
-addr "10.0.0.2" \
-numPorts 8
-numPorts 64
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment