From eb402c8bd4b7722ce4d81796f4b1ac692192c4c9 Mon Sep 17 00:00:00 2001 From: David Wilson Date: Mon, 2 Apr 2018 07:26:52 +0000 Subject: [PATCH] tests/bench: import wrapper script used for blog charts --- tests/bench/linux_record_cpu_net.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100755 tests/bench/linux_record_cpu_net.sh diff --git a/tests/bench/linux_record_cpu_net.sh b/tests/bench/linux_record_cpu_net.sh new file mode 100755 index 00000000..bc5c44ee --- /dev/null +++ b/tests/bench/linux_record_cpu_net.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +# +# Wrap a run of Ansible playbook so that CPU usage counters and network +# activity are logged to files. +# + +[ ! "$1" ] && exit 1 +sudo tcpdump -w $1-out.cap -s 0 host k1.botanicus.net & +date +%s.%N > $1-task-clock.csv +perf stat -x, -I 25 -e task-clock --append -o $1-task-clock.csv ansible-playbook run_hostname_100_times.yml +sudo pkill -f tcpdump