Skip to content
This repository has been archived by the owner on Mar 28, 2018. It is now read-only.

Commit

Permalink
Merge pull request #880 from grahamwhaley/20170505_memscript_robustness
Browse files Browse the repository at this point in the history
tests: metrics: Improve robustness of PSS mem footprint test
  • Loading branch information
jcvenegas authored May 10, 2017
2 parents 426fb8a + 066568e commit 82b10a4
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/metrics/density/docker_memory_usage.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,28 @@ function get_docker_memory_usage(){
sleep "$WAIT_TIME"

# Get PSS memory of CC components.
# And check that the smem search has found the process - we get a "0"
# back if that procedure fails (such as if a process has changed its name
# or is not running when expected to be so)
# As an added bonus - this script must be run as root (or at least as
# a user with enough rights to allow smem to read the smap stats for
# the docker owned processes). Now if you do not have enough rights
# the smem failure to read the stats will also be trapped.
qemu_mem="$(get_pss_memory "$QEMU_BIN")"
if [ "$qemu_mem" == "0" ]; then
die "Failed to find PSS for $QEMU_BIN"
fi

cc_shim_mem="$(get_pss_memory "$SHIM_BIN")"
if [ "$cc_shim_mem" == "0" ]; then
die "Failed to find PSS for $SHIM_BIN"
fi

proxy_mem="$(get_pss_memory "$PROXY_BIN")"
if [ "$proxy_mem" == "0" ]; then
die "Failed to find PSS for $PROXY_BIN"
fi

cc_proxy_mem="$(echo "scale=2; $proxy_mem / $CC_NUMBER" | bc -l)"
cc_mem_usage=$(echo "scale=2; $qemu_mem + $cc_shim_mem + $cc_proxy_mem" | bc -l)

Expand Down

0 comments on commit 82b10a4

Please sign in to comment.