From 02435f13f756917060f52dcf621f6c71da556061 Mon Sep 17 00:00:00 2001 From: Anton Studenov Date: Fri, 28 Oct 2016 20:01:30 +0300 Subject: [PATCH] [Rally profile] Performance of creating atomic timers This patch adds scenario that calculates creation of specified number of atomic timers. Change-Id: I68ba4e7d09fae29f3edb4630d04ad6b981ecbed1 --- rally-jobs/plugins/rally_profile.py | 20 ++++++++++++++++++ rally-jobs/rally.yaml | 32 +++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) diff --git a/rally-jobs/plugins/rally_profile.py b/rally-jobs/plugins/rally_profile.py index 09a2fb75..39951d15 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 70868a99..9e258d47 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