-
Notifications
You must be signed in to change notification settings - Fork 18
Port network metrics #381
Port network metrics #381
Changes from all commits
edfe674
115b1de
05a189e
2c7bb59
c6baf9f
d2b08e3
f67f475
b49d7e9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,11 +64,13 @@ function cpu_consumption { | |
echo >&2 "WARNING: sleeping for $middle_time seconds in order to have server and client stable" | ||
sleep ${middle_time} | ||
qemu_pids=$(pidof ${QEMU_PATH}) | ||
ps --no-headers -o %cpu -p "$qemu_pids" > "$result" | ||
sed -i 's/ //g' "$result" | ||
local total_cpu_consumption=$(awk '{ total += $1 } END { print total/NR }' "$result") | ||
local total_cpu_consumption=$(ps --no-headers -o %cpu \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. much nicer without the temp file, thanks! |
||
-p $(pidof ${QEMU_PATH}) | awk '{ total+= $1 } END { print total/NR }') | ||
echo "The cpu % consumption is : $total_cpu_consumption" | ||
|
||
save_results "network metrics cpu consumption" "" \ | ||
"$total_cpu_consumption" "%" | ||
|
||
clean_environment "$server_name" | ||
$DOCKER_EXE rm -f ${client_name} > /dev/null | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,6 +36,9 @@ extra_args="-ti --rm" | |
|
||
set -e | ||
|
||
## Test name for reporting purposes | ||
test_name="network metrics iperf3" | ||
|
||
# This script will perform all the measurements using a local setup using iperf3 | ||
|
||
# Test single direction TCP bandwith | ||
|
@@ -47,8 +50,16 @@ function iperf3_bandwidth { | |
local client_command="mount -t ramfs -o size=20M ramfs /tmp && iperf3 -c ${server_address} -t ${time}" | ||
start_client "$extra_args" "$client_name" "$image" "$client_command" > "$result" | ||
|
||
local total_bandwidth=$(cat $result | tail -n 3 | head -1 | awk '{print $(NF-2), $(NF-1)}') | ||
echo "Network bandwidth is : $total_bandwidth" | ||
local result_line=$(grep -m1 -E '\breceiver\b' $result) | ||
local -a results | ||
read -a results <<< $result_line | ||
local total_bandwidth=${results[6]} | ||
local total_bandwidth_units=${results[7]} | ||
echo "Network bandwidth is : $total_bandwidth $total_bandwidth_units" | ||
|
||
save_results "${test_name}" "network bandwidth" \ | ||
"$total_bandwidth" "$total_bandwidth_units" | ||
|
||
clean_environment "$server_name" | ||
} | ||
|
||
|
@@ -61,8 +72,16 @@ function iperf3_jitter { | |
local client_command="mount -t ramfs -o size=20M ramfs /tmp && iperf3 -c ${server_address} -u -t ${time}" | ||
start_client "$extra_args" "$client_name" "$image" "$client_command" > "$result" | ||
|
||
local total_jitter=$(cat $result | tail -n 4 | head -1 | awk '{print $(NF-4), $(NF-3)}') | ||
echo "Network jitter is : $total_jitter" | ||
local result_line=$(grep -m1 -A1 -E '\bJitter\b' $result | tail -1) | ||
local -a results | ||
read -a results <<< $result_line | ||
local total_jitter=${results[8]} | ||
local total_jitter_units=${results[9]} | ||
echo "Network jitter is : $total_jitter $total_jitter_units" | ||
|
||
save_results "${test_name}" "network jitter" \ | ||
"$total_jitter" "$total_jitter_units" | ||
|
||
clean_environment "$server_name" | ||
} | ||
|
||
|
@@ -75,10 +94,29 @@ function iperf3_bidirectional_bandwidth_client_server { | |
local client_command="mount -t ramfs -o size=20M ramfs /tmp && iperf3 -c ${server_address} -d -t ${time}" | ||
start_client "$extra_args" "$client_name" "$image" "$client_command" > "$result" | ||
|
||
local total_bidirectional_client_bandwidth=$(cat $result | tail -n 3 | head -1 | awk '{print $(NF-2), $(NF-1)}') | ||
local total_bidirectional_server_bandwidth=$(cat $result | tail -n 4 | head -1 | awk '{print $(NF-3), $(NF-2)}') | ||
echo "Network bidirectional bandwidth (client to server) is : $total_bidirectional_client_bandwidth" | ||
echo "Network bidirectional bandwidth (server to client) is : $total_bidirectional_server_bandwidth" | ||
local client_result=$(grep -m1 -E '\breceiver\b' $result) | ||
local server_result=$(grep -m1 -E '\bsender\b' $result) | ||
local -a client_results | ||
read -a client_results <<< ${client_result} | ||
read -a server_results <<< ${server_result} | ||
local total_bidirectional_client_bandwidth=${client_results[6]} | ||
local total_bidirectional_client_bandwidth_units=${client_results[7]} | ||
local total_bidirectional_server_bandwidth=${server_results[6]} | ||
local total_bidirectional_server_bandwidth_units=${server_results[7]} | ||
echo "Network bidirectional bandwidth (client to server) is :" \ | ||
"$total_bidirectional_client_bandwidth" \ | ||
"$total_bidirectional_client_bandwidth_units" | ||
echo "Network bidirectional bandwidth (server to client) is :" \ | ||
"$total_bidirectional_server_bandwidth" \ | ||
"$total_bidirectional_server_bandwidth_units" | ||
|
||
save_results "${test_name}" "network bidir bw client to server" \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, and here I see what you did with the multi-save of results into a single file... I think that is OK, but you are 'pushing the boundaries' here of what we have in place, so, some notes:
So, not the end of the world, and a pragmatic step forwards in holding mixed and varied results. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If it makes more sense to put each result in an independent file, that's fine, and pretty easy to accomplish. I'd just take the unique info out of Args and append it to Test Name. Let me know if you'd prefer that, or adding another field, etc... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've mulled over this a bit. I'm going to make the call to keep the data together for the minute in a single file. Now that you extract more of the results from some of the tests, I think if we put those into separate files then there is some risk in the future that we'd end up with a set of files and no proof that the data came from the same test run (well, OK, maybe timestamps and commit IDs could give a heavy clue... still...). So, let's leave as is, and then we will fix up |
||
"$total_bidirectional_client_bandwidth" \ | ||
"$total_bidirectional_client_bandwidth_units" | ||
save_results "${test_name}" "network bidir bw server to client" \ | ||
"$total_bidirectional_server_bandwidth" \ | ||
"$total_bidirectional_server_bandwidth_units" | ||
|
||
clean_environment "$server_name" | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -69,10 +69,16 @@ function nginx_ab_networking { | |
sleep "$sleep_secs" | ||
ab -n ${requests} -c ${concurrency} http://${url}/ > "$total_requests" | ||
|
||
result=$(cat "$total_requests" | grep "Requests per second" | cut -d ':' -f2 | sed 's/ //g' | cut -d '[' -f1) | ||
cp -p $total_requests result.test | ||
|
||
local result=$(grep "^Requests per second" $total_requests) | ||
[[ $result =~ :[[:blank:]]*([[:digit:]]+(\.[[:digit:]]*)?) ]] && rps=${BASH_REMATCH[1]} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Argh, my eyes! ;-) Well, OK, it is more efficient than the pipelined version, and in some ways more understandable as it pretty much lays out the format that it is parsing... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I avoided leaning toothpicks :) I considered pasting sample data in a comment above, but realized I'd probably have to sanitize that since it's actual benchmarking results. |
||
$DOCKER_EXE rm -f ${container_name} > /dev/null | ||
rm -f "$total_requests" | ||
} | ||
|
||
nginx_ab_networking | ||
echo "The total of requests per second is : $result" | ||
echo "The total of requests per second is : $rps" | ||
save_results "network nginx ab benchmark" \ | ||
"requests=${requests} concurrency=${concurrency}" \ | ||
"$rps" "requests/s" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, a note/thought. Probably not going to block this for the minute, but...
I ran the tests initially with
RUNTIME=runc
, because my local CC install may have been a little in-flux... and of courserunc
does not have any QEMU processes, so we actually bomb or fail some of the tests (like when we try to do aps
of thepids
of QEMU, we fail theps
, and then we get a divide by zero error etc.So, later maybe, we should make the scripts spot that there is no QEMU, and gracefully-ish fail.
That, or we make
run_all_metrics.sh
more intelligent about which tests can be run for which runtimes, maybe.But, for now, we'd really like to be running these tests with CC3.x, so I will install and test that...