From 52e4b8840cd53978af7c4114e658aa2a31bcb1f5 Mon Sep 17 00:00:00 2001 From: Andreas Hellander Date: Mon, 11 Mar 2024 13:01:32 +0100 Subject: [PATCH] Added load test based on shuffling numpy arrays --- examples/load-test/README.md | 13 +++++-------- examples/load-test/run_clients.py | 4 ++-- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/examples/load-test/README.md b/examples/load-test/README.md index dbc6c0103..20ec0ba77 100644 --- a/examples/load-test/README.md +++ b/examples/load-test/README.md @@ -40,17 +40,14 @@ tar -czvf package.tgz client python client/entrypoint init_seed ``` -### Deploy FEDn and two clients -docker-compose -f ../../docker-compose.yaml -f docker-compose.override.yaml up - -### Initialize the FEDn network +### Initialize the FEDn network and run an experiment Edit 'init_fedn.py' to configure the FEDn host (controller) to connect to, then ``` python init_fedn.py ``` -Launch clients -> **Note**: run with `--scale client=N` to start *N* clients. +Launch clients and run a training session/experiment: -## Clean up -You can clean up by running `docker-compose down -v`. +``` +python run_clients.py +``` diff --git a/examples/load-test/run_clients.py b/examples/load-test/run_clients.py index 780360b7b..a1db333f0 100644 --- a/examples/load-test/run_clients.py +++ b/examples/load-test/run_clients.py @@ -50,8 +50,8 @@ } result_fedavg = client.start_session(**session_config_fedavg) - while not client.session_is_finished(session_id): - time.sleep(2) + while not client.session_is_finished(session_config_fedavg['session_id']): + time.sleep(1) # Disconnect clients time.sleep(CLIENTS_AVAILABLE_TIME)