mirror of
https://github.com/logos-storage/logos-storage-local-harness.git
synced 2026-01-05 23:13:07 +00:00
feat: add configurable seeder count to k-node experiment
This commit is contained in:
parent
18b86ef7cf
commit
ef90f34ff6
@ -16,10 +16,12 @@ SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
|||||||
source "${SCRIPT_DIR}/../src/clh"
|
source "${SCRIPT_DIR}/../src/clh"
|
||||||
|
|
||||||
node_count="${1:-2}"
|
node_count="${1:-2}"
|
||||||
repetitions="${2:-1}"
|
seeder_count="${2:-1}"
|
||||||
output_log="${3:-"${OUTPUTS}/k-node-$(date +%s)-${RANDOM}.csv"}"
|
repetitions="${3:-1}"
|
||||||
if [ "$#" -gt 3 ]; then
|
output_log="${4:-"${OUTPUTS}/k-node-$(date +%s)-${RANDOM}.csv"}"
|
||||||
shift 3
|
|
||||||
|
if [ "$#" -gt 4 ]; then
|
||||||
|
shift 4
|
||||||
file_sizes=("$@")
|
file_sizes=("$@")
|
||||||
else
|
else
|
||||||
echoerr "No file sizes specified, using default (100)."
|
echoerr "No file sizes specified, using default (100)."
|
||||||
@ -29,6 +31,7 @@ fi
|
|||||||
exp_start "k-node"
|
exp_start "k-node"
|
||||||
|
|
||||||
echoerr "* Nodes: ${node_count}"
|
echoerr "* Nodes: ${node_count}"
|
||||||
|
echoerr "* Seeders: ${seeder_count}"
|
||||||
echoerr "* Repetitions: ${repetitions}"
|
echoerr "* Repetitions: ${repetitions}"
|
||||||
echoerr "* File Sizes: ${file_sizes[*]}"
|
echoerr "* File Sizes: ${file_sizes[*]}"
|
||||||
echoerr "* Timing log: ${output_log}"
|
echoerr "* Timing log: ${output_log}"
|
||||||
@ -40,18 +43,20 @@ echoerr "* Timing log: ${output_log}"
|
|||||||
trap pm_stop EXIT INT TERM
|
trap pm_stop EXIT INT TERM
|
||||||
pm_start
|
pm_start
|
||||||
|
|
||||||
#cdx_set_log_level "INFO;trace:blockexcnetwork,blockexcengine,discoveryengine"
|
cdx_set_log_level "INFO;trace:blockexcnetwork,blockexcengine,discoveryengine"
|
||||||
cdx_launch_network "${node_count}"
|
cdx_launch_network "${node_count}"
|
||||||
|
|
||||||
for file_size in "${file_sizes[@]}"; do
|
for file_size in "${file_sizes[@]}"; do
|
||||||
for i in $(seq 1 "${repetitions}"); do
|
for i in $(seq 1 "${repetitions}"); do
|
||||||
file_name=$(cdx_generate_file "${file_size}")
|
file_name=$(cdx_generate_file "${file_size}")
|
||||||
cid=$(cdx_upload_file "0" "${file_name}")
|
for j in $(seq 0 "$((seeder_count - 1))"); do
|
||||||
|
cid=$(cdx_upload_file "${j}" "${file_name}")
|
||||||
|
done
|
||||||
|
|
||||||
cdx_log_timings_start "${output_log}" "${file_size},${i},${cid}"
|
cdx_log_timings_start "${output_log}" "${file_size},${i},${cid}"
|
||||||
|
|
||||||
handles=()
|
handles=()
|
||||||
for j in $(seq 1 "$((node_count - 1))"); do
|
for j in $(seq "${seeder_count}" "$((node_count - 1))"); do
|
||||||
cdx_download_file_async "$j" "$cid"
|
cdx_download_file_async "$j" "$cid"
|
||||||
# shellcheck disable=SC2128
|
# shellcheck disable=SC2128
|
||||||
handles+=("$result")
|
handles+=("$result")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user