diff --git a/rally-jobs/plugins/rally_profile.py b/rally-jobs/plugins/rally_profile.py index 09a2fb752a..39951d157d 100644 --- a/rally-jobs/plugins/rally_profile.py +++ b/rally-jobs/plugins/rally_profile.py @@ -30,3 +30,23 @@ class GenerateNamesInAtomic(scenario.Scenario, utils.RandomNameGeneratorMixin): with atomic.ActionTimer(self, "generate_%s_names" % number_of_names): for i in range(number_of_names): self.generate_random_name() + + +@scenario.configure(name="RallyProfile.calculate_atomic") +class CalculateAtomic(scenario.Scenario, utils.RandomNameGeneratorMixin): + + def run(self, number_of_atomics): + """Calculate atomic actions. + + :param number_of_atomics: int number of atomics to run + """ + tmp_name = "tmp_actions" + + calc_atomic_name = "calculate_%s_atomics" % number_of_atomics + with atomic.ActionTimer(self, calc_atomic_name): + for _ in range(number_of_atomics): + with atomic.ActionTimer(self, tmp_name): + pass + + self._atomic_actions = { + calc_atomic_name: self._atomic_actions[calc_atomic_name]} diff --git a/rally-jobs/rally.yaml b/rally-jobs/rally.yaml index 70868a99c1..9e258d472c 100644 --- a/rally-jobs/rally.yaml +++ b/rally-jobs/rally.yaml @@ -818,6 +818,8 @@ times: 1000 concurrency: 10 sla: + max_avg_duration_per_atomic: + generate_100_names: 0.006 failure_rate: max: 0 - @@ -828,6 +830,8 @@ times: 500 concurrency: 10 sla: + max_avg_duration_per_atomic: + generate_1000_names: 0.046 failure_rate: max: 0 - @@ -838,6 +842,34 @@ times: 200 concurrency: 10 sla: + max_avg_duration_per_atomic: + generate_10000_names: 0.415 + failure_rate: + max: 0 + + RallyProfile.calculate_atomic: + - + args: + number_of_atomics: 100 + runner: + type: "constant" + times: 300 + concurrency: 10 + sla: + max_avg_duration_per_atomic: + calculate_100_atomics: 0.025 + failure_rate: + max: 0 + - + args: + number_of_atomics: 500 + runner: + type: "constant" + times: 100 + concurrency: 10 + sla: + max_avg_duration_per_atomic: + calculate_500_atomics: 0.46 failure_rate: max: 0