From b36ebc87f449af5ad7a677350a3ccfc7d26cfb1e Mon Sep 17 00:00:00 2001 From: drebs Date: Thu, 2 Nov 2017 09:28:56 -0200 Subject: move client responsiveness tests to a subfolder --- .../scripts/measure_perf_series.py | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100755 client-responsiveness/scripts/measure_perf_series.py (limited to 'client-responsiveness/scripts/measure_perf_series.py') diff --git a/client-responsiveness/scripts/measure_perf_series.py b/client-responsiveness/scripts/measure_perf_series.py new file mode 100755 index 0000000..587ff7a --- /dev/null +++ b/client-responsiveness/scripts/measure_perf_series.py @@ -0,0 +1,31 @@ +#!/usr/bin/env python + +import commands +import datetime + +# How many points to measure. Make sure that you leave the baseline +# running for a significative amount before triggering the sync, it's possible +# you have significant variability in there. +POINTS = 400 + +SCALE = 50 + +commands.getoutput('echo time req/s cpu mem sync_phase sync_exchange_phase > ./out/series.log') +start = datetime.datetime.now() + +for i in range(POINTS): + value = commands.getoutput('./scripts/get_ping_rate.py') + print "Step", i, "...", value + stats = commands.getoutput('./scripts/get_client_stats.py') + cpu, mem, sync_phase, sync_exchange_phase = stats.split() + sync_phase = str(int(sync_phase)*SCALE) + sync_exchange_phase = str(int(sync_exchange_phase)*SCALE) + now = datetime.datetime.now() + secs = (now - start).total_seconds() + try: + # make it so the script exits succesfully when the server is dead + commands.getoutput( + 'echo %s\t%s\t%s\t%s\t%s\t%s >> ./out/series.log' \ + % (secs, value, cpu, mem, sync_phase, sync_exchange_phase)) + except ValueError: + break -- cgit v1.2.3