[Reports][CLI] Introduce Trends report

New HTML report for statistics trends for given tasks
which is generated by cli command "rally task trends".

Blueprint: trends-report
Change-Id: I0805058e8bd225796b02516fad094d73037d5495
This commit is contained in:
Alexander Maretskiy 2016-03-17 18:09:13 +02:00
parent d3c94fd988
commit f03fcccc69
2 changed files with 36 additions and 1 deletions

View File

@ -43,6 +43,7 @@ _rally()
OPTS["task_sla_check"]="--uuid --json"
OPTS["task_start"]="--deployment --task --task-args --task-args-file --tag --no-use --abort-on-sla-failure"
OPTS["task_status"]="--uuid"
OPTS["task_trends"]="--out --open --tasks"
OPTS["task_use"]="--uuid"
OPTS["task_validate"]="--deployment --task --task-args --task-args-file"
OPTS["verify_compare"]="--uuid-1 --uuid-2 --csv --html --json --output-file --threshold"
@ -87,4 +88,4 @@ _rally()
return 0
}
complete -o filenames -F _rally rally
complete -o filenames -F _rally rally

View File

@ -317,6 +317,40 @@ class TaskTestCase(unittest.TestCase):
self.assertTrue(os.path.exists(html_report))
self._assert_html_report_libs_are_embedded(html_report)
def test_trends(self):
cfg1 = {
"Dummy.dummy": [
{"runner": {"type": "constant", "times": 2,
"concurrency": 2}}],
"Dummy.dummy_random_action": [
{"args": {"actions_num": 4},
"runner": {"type": "constant", "times": 2, "concurrency": 2}},
{"runner": {"type": "constant", "times": 2,
"concurrency": 2}}]}
cfg2 = {
"Dummy.dummy": [
{"args": {"sleep": 0.6},
"runner": {"type": "constant", "times": 2,
"concurrency": 2}}]}
config1 = utils.TaskConfig(cfg1)
config2 = utils.TaskConfig(cfg2)
rally = utils.Rally()
report = rally.gen_report_path(extension="html")
for i in range(5):
rally("task start --task %(file)s --tag trends_run_%(idx)d"
% {"file": config1.filename, "idx": i})
rally("task start --task %s --tag trends_run_once" % config2.filename)
tasks_list = rally("task list")
uuids = [u[2:38] for u in tasks_list.split("\n") if "trends_run" in u]
rally("task trends %(uuids)s --out %(report)s"
% {"uuids": " ".join(uuids), "report": report})
del config1, config2
self.assertTrue(os.path.exists(report))
def test_delete(self):
rally = utils.Rally()
cfg = self._get_sample_task_config()