Add daemon mode to benchmark
Change-Id: I9dbd71abc9cb7cca75582910be0eeefc27a1a174
This commit is contained in:
parent
ed45e5aa6d
commit
0c6ba4bbe3
@ -22,6 +22,8 @@ import subprocess
|
|||||||
import sys
|
import sys
|
||||||
import timeit
|
import timeit
|
||||||
|
|
||||||
|
from oslo.rootwrap import client
|
||||||
|
|
||||||
config_path = "rootwrap.conf"
|
config_path = "rootwrap.conf"
|
||||||
num_iterations = 100
|
num_iterations = 100
|
||||||
|
|
||||||
@ -45,6 +47,11 @@ def run_rootwrap(cmd):
|
|||||||
"from oslo.rootwrap import cmd; cmd.main()", config_path] + cmd)
|
"from oslo.rootwrap import cmd; cmd.main()", config_path] + cmd)
|
||||||
|
|
||||||
|
|
||||||
|
run_daemon = client.Client([
|
||||||
|
"sudo", sys.executable, "-c",
|
||||||
|
"from oslo.rootwrap import cmd; cmd.daemon()", config_path]).execute
|
||||||
|
|
||||||
|
|
||||||
def run_one(runner, cmd):
|
def run_one(runner, cmd):
|
||||||
def __inner():
|
def __inner():
|
||||||
code, out, err = runner(cmd)
|
code, out, err = runner(cmd)
|
||||||
@ -56,6 +63,7 @@ runners = [
|
|||||||
("{0}", run_plain),
|
("{0}", run_plain),
|
||||||
("sudo {0}", run_sudo),
|
("sudo {0}", run_sudo),
|
||||||
("sudo rootwrap conf {0}", run_rootwrap),
|
("sudo rootwrap conf {0}", run_rootwrap),
|
||||||
|
("daemon.run('{0}')", run_daemon),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user