def test(self):
'''
Test Execution with necessary args
'''
dir = self.params.get('dir', default='.')
nprocs = self.params.get('nprocs', default=None)
seconds = self.params.get('seconds', default=60)
args = self.params.get('args', default='')
if not nprocs:
nprocs = multiprocessing.cpu_count()
loadfile = os.path.join(self.sourcedir, 'client.txt')
cmd = '%s/dbench %s %s -D %s -c %s -t %d' % (self.sourcedir, nprocs,
args, dir, loadfile,
seconds)
process.run(cmd)
self.results = process.system_output(cmd)
pattern = re.compile(r"Throughput (.*?) MB/sec (.*?) procs")
(throughput, procs) = pattern.findall(self.results)[0]
self.whiteboard = json.dumps({'throughput': throughput,
'procs': procs})
dbench.py 文件源码
python
阅读 25
收藏 0
点赞 0
评论 0
评论列表
文章目录