diff options
author | drebs <drebs@riseup.net> | 2017-10-29 14:28:12 -0200 |
---|---|---|
committer | drebs <drebs@riseup.net> | 2017-11-02 09:36:31 -0200 |
commit | a7f93cec7999de04614d7adaf91c4348a3313e2e (patch) | |
tree | ea7e089f0f3d7baec50bc34f0cf39bbedefcd8fd /scripts/scalability/test_controller/server/utils.py | |
parent | 21584bc33fdc672a0f59436ba5d66f66439d6366 (diff) |
[benchmarks] add some orchestration to scalability tests
Diffstat (limited to 'scripts/scalability/test_controller/server/utils.py')
-rw-r--r-- | scripts/scalability/test_controller/server/utils.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/scripts/scalability/test_controller/server/utils.py b/scripts/scalability/test_controller/server/utils.py new file mode 100644 index 00000000..a8274490 --- /dev/null +++ b/scripts/scalability/test_controller/server/utils.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python + +from subprocess import check_output +from psutil import Process + +args = set([ + '/usr/bin/twistd', + '--python=/usr/lib/python2.7/dist-packages/leap/soledad/server/server.tac', +]) + + +def get_soledad_server_pid(): + output = check_output(['pidof', 'python']) + for pid in output.split(): + proc = Process(int(pid)) + cmdline = proc.cmdline() + if args.issubset(set(cmdline)): + return int(pid) + + +if __name__ == '__main__': + print get_soledad_server_pid() |