From d7e02ebd152cde198654c306792fe44ff8bf6b90 Mon Sep 17 00:00:00 2001 From: "Kali Kaneko (leap communications)" Date: Sun, 10 Apr 2016 19:00:23 -0400 Subject: graph cpu/mem too --- Makefile | 2 +- graphit | 3 ++- measure-perf-series.py | 24 ++++++++++++++++++++++++ series-ping.py | 24 ------------------------ 4 files changed, 27 insertions(+), 26 deletions(-) create mode 100644 measure-perf-series.py delete mode 100644 series-ping.py diff --git a/Makefile b/Makefile index e943803..606b55a 100644 --- a/Makefile +++ b/Makefile @@ -16,7 +16,7 @@ measure-series: # TODO add cpu/ram usage (ping command COULD RETURN THAT!) rm -f /tmp/soledadsync/* rm -f series.log - python series-ping.py + python measure-perf-series.py graph-series: data=series.log ./graphit diff --git a/graphit b/graphit index f40ab2e..250b99e 100755 --- a/graphit +++ b/graphit @@ -4,5 +4,6 @@ filename=system("echo $data") set title filename set key outside #plot name with linespoints notitle -plot for [col=1:3] filename using 0:col with lines notitle +#plot filename using 1:2 with linespoints title columnheader +plot for [col=2:4] filename using 1:col with lines title columnheader pause -1 diff --git a/measure-perf-series.py b/measure-perf-series.py new file mode 100644 index 0000000..24e9d5f --- /dev/null +++ b/measure-perf-series.py @@ -0,0 +1,24 @@ +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 = 200 + +start = datetime.datetime.now() + +for i in range(POINTS): + value = commands.getoutput('python get_ping_rate.py') + print "Step", i, "...", value + # TODO --- cpu/mem too brittle. + cpu_mem = commands.getoutput('python get-client-cpu-mem.py') + cpu, mem = cpu_mem.split() + print "CPU/MEM", cpu, mem + now = datetime.datetime.now() + secs = (now - start).total_seconds() + #print "TOOK", secs, "seconds" + commands.getoutput( + #'echo %s\t%s >> series.log' % (secs, value)) + 'echo %s\t%s\t%s\t%s >> series.log' % (secs, value, cpu, mem)) + #, cpu, mem)) diff --git a/series-ping.py b/series-ping.py deleted file mode 100644 index dd6277d..0000000 --- a/series-ping.py +++ /dev/null @@ -1,24 +0,0 @@ -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 = 200 - -start = datetime.datetime.now() - -for i in range(POINTS): - value = commands.getoutput('python get_ping_rate.py') - print "Step", i, "...", value - # TODO --- cpu/mem too brittle. - #cpu_mem = commands.getoutput('python get-client-cpu-mem.py') - #cpu, mem = cpu_mem.split() - #print "CPU/MEM", cpu, mem - now = datetime.datetime.now() - secs = (now - start).total_seconds() - #print "TOOK", secs, "seconds" - commands.getoutput( - 'echo %s\t%s >> series.log' % (secs, value)) - #'echo %s\t%s\t%s\t%s >> series.log' % (secs, value)) - #, cpu, mem)) -- cgit v1.2.3