aboutsummaryrefslogtreecommitdiffstats
path: root/tools/load_gen
diff options
context:
space:
mode:
Diffstat (limited to 'tools/load_gen')
-rw-r--r--tools/load_gen/dummy/dummy.py2
-rw-r--r--tools/load_gen/stress/stress.py7
2 files changed, 5 insertions, 4 deletions
diff --git a/tools/load_gen/dummy/dummy.py b/tools/load_gen/dummy/dummy.py
index 74fc33b7..1ad6c3fd 100644
--- a/tools/load_gen/dummy/dummy.py
+++ b/tools/load_gen/dummy/dummy.py
@@ -26,6 +26,6 @@ class DummyLoadGen(ILoadGenerator):
"""Start stress load if it was requested"""
pass
- def kill(self):
+ def kill(self, signal='-15', sleep=2):
"""Kill stress load if it is active"""
pass
diff --git a/tools/load_gen/stress/stress.py b/tools/load_gen/stress/stress.py
index 4a53f2d2..4c69a170 100644
--- a/tools/load_gen/stress/stress.py
+++ b/tools/load_gen/stress/stress.py
@@ -18,6 +18,7 @@
import logging
import subprocess
import copy
+import time
from tools import tasks
from tools import systeminfo
from tools.load_gen.load_gen import ILoadGenerator
@@ -111,13 +112,13 @@ class Stress(ILoadGenerator):
if self._running:
super(Stress, self).start()
- def kill(self):
+ def kill(self, signal='-15', sleep=2):
"""
Kill stress load if it is active
"""
if self._running and self._child and self._child.isalive():
- tasks.run_task(['sudo', 'pkill', self._proc_name],
- self._logger)
+ tasks.run_task(['sudo', 'pkill', signal, self._proc_name], self._logger)
+ time.sleep(sleep)
self._logger.info(
'Log available at %s', self._logfile)