Update Titlepage with links to individual sections
[matches/MCTX3420.git] / testing / data_performance / plot.py
1 #!/usr/bin/python
2
3 import sys
4 import os
5 import Gnuplot
6 import subprocess
7 import numpy
8
9 methods = ["sqlite", "csv", "binfile"]
10 data = {}
11 averages = 100
12 g = Gnuplot.Gnuplot()
13
14
15 for program in methods:
16         data.update({program : []})
17         
18         numpoints = 1
19         while (numpoints < 10000):
20                 bufsiz = 1
21                 while (bufsiz < 2):
22                         
23                         run = ["./"+program, str(bufsiz), str(numpoints)]
24                         times = []
25                         for i in xrange(averages):
26                                 p = subprocess.Popen(run, stdout=subprocess.PIPE, stderr=subprocess.PIPE)       
27                                 times.append(float(p.stdout.readline().strip(" \r\n")))
28
29                         times = numpy.array(times)
30                         data[program].append([numpoints,bufsiz,numpy.mean(times), numpy.std(times)])
31
32                         bufsiz *= 10
33                 numpoints += 100
34
35         g("set xlabel \"Data Points\"")
36         g("set ylabel \"Total Time (s)\"")
37         g("set title \"Time to Store Data Points\"")
38         g.replot(Gnuplot.Data(data[program], title=program, with_="lp",using="1:3"))
39
40 print "Done!"
41 sys.stdin.readline()
42                 
43
44         

UCC git Repository :: git.ucc.asn.au