diff options
author | Lars Wirzenius <liw@liw.fi> | 2020-10-18 16:22:26 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2020-10-18 16:22:26 +0300 |
commit | 427e7bc36be9e4585eaf2ab94f3abdef9ed483f8 (patch) | |
tree | f65e50b32e05ae188ccc74fc8b8de3bdb159e4fd /benchmarker | |
parent | 0f38069c7de58180f192a48cc1c4da49a1823688 (diff) | |
download | benchmarker-master.tar.gz |
Diffstat (limited to 'benchmarker')
-rwxr-xr-x | benchmarker | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/benchmarker b/benchmarker index 8dd1df9..3dea077 100755 --- a/benchmarker +++ b/benchmarker @@ -43,12 +43,31 @@ network_localhost() size=10G truncate -s "$size" "$filename" - echo "Network benchmark (netcat a $size sparse file across localhost)" + echo "Network benchmark (netcat a $size sparse file to localhost)" nc -l localhost "$port" > /dev/null & /bin/time --format="%e" nc -N localhost "$port" < "$filename" rm -f "$filename" } +netbench_remote() +{ + local filename + local port + local size + local host + + filename="$(mktemp)" + host="$BENCHMARK_REMOTE" + port=3858 + size=10G + truncate -s "$size" "$filename" + + echo "Network benchmark (netcat a $size sparse file to $host)" + ssh "$host" "nc -l localhost $port > /dev/null" & + /bin/time --format="%e" nc -N localhost "$port" < "$filename" + rm -f "$filename" +} + for bench in "$@" do case "$bench" in @@ -58,6 +77,9 @@ do network-localhost) netbench_localhost ;; + network-remote) + netbench_remote + ;; *) die "unknown benchmark type $bench" ;; |