edit
[c11concurrency-benchmarks.git] / silo / benchmarks / stats_runner.py
1 #!/usr/bin/env python
2
3 import itertools as it
4 import platform
5 import math
6 import subprocess
7 import sys
8 import time
9 import multiprocessing as mp
10 import os
11
12 BUILDDIR='../out-perf.ectrs'
13 if __name__ == '__main__':
14   (_, out) = sys.argv
15
16   args = [
17       os.path.join(BUILDDIR, 'benchmarks/dbtest'),
18       '--bench-opts', '--workload-mix 0,0,100,0',
19       '--stats-server-sockfile' , '/tmp/silo.sock',
20       '--num-threads', '28',
21       '--numa-memory', '96G',
22       '--scale-factor', '160000',
23       '--parallel-loading',
24       '--runtime', '30',
25   ]
26   env = dict(os.environ)
27   env['DISABLE_MADV_WILLNEED'] = '1'
28   p0 = subprocess.Popen(args, stdin=open('/dev/null', 'r'), stdout=open('/dev/null', 'w'), env=env)
29   time.sleep(1.0) # XXX: hacky
30   args = [os.path.join(BUILDDIR, 'stats_client'), '/tmp/silo.sock', 'dbtuple_bytes_allocated:dbtuple_bytes_freed']
31   with open(out, 'w') as fp:
32     p1 = subprocess.Popen(args, stdin=open('/dev/null', 'r'), stdout=fp)
33     p0.wait()
34     p1.wait()