Fix a bug for algorithm of arithmetic runner.
[yardstick.git] / yardstick / benchmark / runners / arithmetic.py
old mode 100644 (file)
new mode 100755 (executable)
index a3aceb3..f73d1cd
@@ -48,8 +48,9 @@ def _worker_process(queue, cls, method_name, context, scenario_args):
     sla_action = None
     if "sla" in scenario_args:
         sla_action = scenario_args["sla"].get("action", "assert")
+    margin = 1 if step > 0 else -1
 
-    for value in range(start, stop, step):
+    for value in range(start, stop+margin, step):
 
         options[arg_name] = value
 
@@ -97,6 +98,30 @@ def _worker_process(queue, cls, method_name, context, scenario_args):
 
 
 class ArithmeticRunner(base.Runner):
+    '''Run a scenario arithmetically stepping an input value
+
+  Parameters
+    interval - time to wait between each scenario invocation
+        type:    int
+        unit:    seconds
+        default: 1 sec
+    name - name of scenario option that will be increased for each invocation
+        type:    string
+        unit:    na
+        default: none
+    start - value to use in first invocation of scenario
+        type:    int
+        unit:    na
+        default: none
+    step - value added to start value in next invocation of scenario
+        type:    int
+        unit:    na
+        default: none
+    stop - value indicating end of invocation
+        type:    int
+        unit:    na
+        default: none
+    '''
 
     __execution_type__ = 'Arithmetic'