From ae36f44de7b9adbfa56525dd0046311ea7181288 Mon Sep 17 00:00:00 2001 From: Jan Tuomi Date: Thu, 15 May 2025 12:34:57 +0300 Subject: Run formatter, add ruff config --- benchmark_throughput.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'benchmark_throughput.py') diff --git a/benchmark_throughput.py b/benchmark_throughput.py index b21c28a..c3cae27 100644 --- a/benchmark_throughput.py +++ b/benchmark_throughput.py @@ -5,6 +5,7 @@ import argparse from random import randint from femtoqueue import FemtoQueue + def run_benchmark(duration_seconds: int, payload_size: int = 100): print(f"Running throughput benchmark for {duration_seconds} sec. See -h for help.") tmpdir = tempfile.mkdtemp() @@ -47,9 +48,16 @@ def run_benchmark(duration_seconds: int, payload_size: int = 100): print(f"Total tasks processed: {total_count}") print(f"Overall throughput: {total_count / elapsed:.2f} tasks/sec") + if __name__ == "__main__": parser = argparse.ArgumentParser(description="FemtoQueue throughput benchmark") - parser.add_argument("--duration", type=int, help="Duration to run the benchmark (in seconds)", default=10, required=False) + parser.add_argument( + "--duration", + type=int, + help="Duration to run the benchmark (in seconds)", + default=10, + required=False, + ) args = parser.parse_args() run_benchmark(args.duration) -- cgit v1.3