diff options
| author | Jan Tuomi <jan@jantuomi.fi> | 2025-05-15 12:34:57 +0300 |
|---|---|---|
| committer | Jan Tuomi <jan@jantuomi.fi> | 2025-05-15 12:34:57 +0300 |
| commit | ae36f44de7b9adbfa56525dd0046311ea7181288 (patch) | |
| tree | 2cf714e28240204dd95e5b35bcde608d6f135d65 /benchmark_throughput.py | |
| parent | 8d4fa3b038493df8f2b6108cef669d5434b1736e (diff) | |
Run formatter, add ruff config
Diffstat (limited to 'benchmark_throughput.py')
| -rw-r--r-- | benchmark_throughput.py | 10 |
1 files changed, 9 insertions, 1 deletions
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) |
