summaryrefslogtreecommitdiff
path: root/measure-perf-series.py
diff options
context:
space:
mode:
Diffstat (limited to 'measure-perf-series.py')
-rw-r--r--measure-perf-series.py24
1 files changed, 24 insertions, 0 deletions
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))