Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(501)

Side by Side Diff: client/tests/dbench/dbench.py

Issue 1595019: Merge remote branch 'origin/upstream' into tempbranch (Closed)
Patch Set: Created 10 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « client/profilers/powertop/powertop.py ('k') | client/tests/iperf/iperf.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 import os, re 1 import os, re
2 2
3 from autotest_lib.client.bin import utils, test 3 from autotest_lib.client.bin import utils, test
4 4
5 class dbench(test.test): 5 class dbench(test.test):
6 version = 3 6 version = 3
7 7
8 # http://samba.org/ftp/tridge/dbench/dbench-3.04.tar.gz 8 # http://samba.org/ftp/tridge/dbench/dbench-3.04.tar.gz
9 def setup(self, tarball='dbench-3.04.tar.gz'): 9 def setup(self, tarball='dbench-3.04.tar.gz'):
10 tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir) 10 tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir)
11 utils.extract_tarball_to_dir(tarball, self.srcdir) 11 utils.extract_tarball_to_dir(tarball, self.srcdir)
12 os.chdir(self.srcdir) 12 os.chdir(self.srcdir)
13 13
14 utils.system('patch -p1 < ../dbench_startup.patch') 14 utils.system('patch -p1 < ../dbench_startup.patch')
15 # CBUILD and CHOST is env vars used inside Chromium OS build environment 15 utils.configure()
16 # for cross compiling.
17 if 'CBUILD' in os.environ and 'CHOST' in os.environ:
18 config_params = '--build=%s --host=%s' % (os.environ['CBUILD'],
19 os.environ['CHOST'])
20 else:
21 config_params = ''
22 utils.system('./configure %s' % config_params)
23 utils.system('make') 16 utils.system('make')
24 17
25 18
26 def initialize(self): 19 def initialize(self):
27 self.job.require_gcc() 20 self.job.require_gcc()
28 self.results = [] 21 self.results = []
29 self.dbench = os.path.join(self.srcdir, 'dbench') 22 self.dbench = os.path.join(self.srcdir, 'dbench')
30 23
31 24
32 def run_once(self, dir='.', nprocs=None, seconds=600, args=''): 25 def run_once(self, dir='.', nprocs=None, seconds=600, args=''):
33 if not nprocs: 26 if not nprocs:
34 nprocs = self.job.cpu_count() 27 nprocs = self.job.cpu_count()
35 loadfile = os.path.join(self.srcdir, 'client.txt') 28 loadfile = os.path.join(self.srcdir, 'client.txt')
36 cmd = '%s %s %s -D %s -c %s -t %d' % (self.dbench, nprocs, args, 29 cmd = '%s %s %s -D %s -c %s -t %d' % (self.dbench, nprocs, args,
37 dir, loadfile, seconds) 30 dir, loadfile, seconds)
38 self.results = utils.system_output(cmd, retain_output=True) 31 self.results = utils.system_output(cmd, retain_output=True)
39 32
40 33
41 def postprocess_iteration(self): 34 def postprocess_iteration(self):
42 pattern = re.compile(r"Throughput (.*?) MB/sec (.*?) procs") 35 pattern = re.compile(r"Throughput (.*?) MB/sec (.*?) procs")
43 (throughput, procs) = pattern.findall(self.results)[0] 36 (throughput, procs) = pattern.findall(self.results)[0]
44 self.write_perf_keyval({'throughput':throughput, 'procs':procs}) 37 self.write_perf_keyval({'throughput':throughput, 'procs':procs})
OLDNEW
« no previous file with comments | « client/profilers/powertop/powertop.py ('k') | client/tests/iperf/iperf.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698