From d0545a2308d4ce6d4679f8b6ed2411df7386d34b Mon Sep 17 00:00:00 2001 From: Burkhard Ringlein Date: Mon, 8 Jul 2024 10:52:06 +0200 Subject: [PATCH] adding dump of combined results (#25) --- .env.example | 3 +++ fmperf/loadgen/sweep.py | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/.env.example b/.env.example index 339f12b..3e9186e 100644 --- a/.env.example +++ b/.env.example @@ -25,6 +25,9 @@ REQUESTS_FILENAME=sample_requests.json # results file RESULTS_FILENAME=results.json +# filename for combined results +RESULTS_ALL_FILENAME=results_all.json + # number of virtual users NUM_USERS=1 diff --git a/fmperf/loadgen/sweep.py b/fmperf/loadgen/sweep.py index 938001f..7c68b1b 100644 --- a/fmperf/loadgen/sweep.py +++ b/fmperf/loadgen/sweep.py @@ -21,3 +21,8 @@ results.extend(tmp["results"]) parse_results(results, print_df=True) + +outfile = f"/requests/{os.environ['RESULTS_ALL_FILENAME']}" +print(f">> writing all results to file: {outfile}") +with open(outfile, "w") as f: + json.dump(results, f)