summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbenchmarker24
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"
;;