summaryrefslogtreecommitdiffstats
path: root/qtip/reporter
diff options
context:
space:
mode:
authorYujun Zhang <zhang.yujunz@zte.com.cn>2017-02-22 16:57:48 +0800
committerYujun Zhang <zhang.yujunz@zte.com.cn>2017-02-22 17:04:47 +0800
commit4727d91cae2e71f6ae0751f4d6e6559d5221b0f2 (patch)
treef99fc83a3a2b2cebc538e15e0065afc4a2b61746 /qtip/reporter
parent8a5cb9aebdb7c763fae470fa00beecf07c81fb1d (diff)
Add reporter PoC
Change-Id: I5134a0d95d75fcb3a75267a5f20b4ace8638156a Signed-off-by: Yujun Zhang <zhang.yujunz@zte.com.cn>
Diffstat (limited to 'qtip/reporter')
-rw-r--r--qtip/reporter/base.py14
-rw-r--r--qtip/reporter/console.py (renamed from qtip/reporter/console/__init__.py)14
-rw-r--r--qtip/reporter/templates/timeline.j2 (renamed from qtip/reporter/console/timeline.j2)0
3 files changed, 11 insertions, 17 deletions
diff --git a/qtip/reporter/base.py b/qtip/reporter/base.py
deleted file mode 100644
index b931d14d..00000000
--- a/qtip/reporter/base.py
+++ /dev/null
@@ -1,14 +0,0 @@
-##############################################################################
-# Copyright (c) 2016 ZTE Corp and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-
-
-class BaseReporter(object):
- """benchmark result reporter"""
- def __init__(self, collector=None):
- self.collector = collector
diff --git a/qtip/reporter/console/__init__.py b/qtip/reporter/console.py
index 02d63288..24c98e74 100644
--- a/qtip/reporter/console/__init__.py
+++ b/qtip/reporter/console.py
@@ -7,9 +7,17 @@
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
+from qtip.base import BaseActor
-from qtip.reporter.base import BaseReporter
+class ConsoleReporter(BaseActor):
+ """
+ report benchmark result to console
+ """
+ def __init__(self, config, parent=None):
+ super(ConsoleReporter, self).__init__(config, parent=parent)
+ # TODO(yujunz) remove PoC code
+ self._fmt = "{title}: {description}"
-class ConsoleReporter(BaseReporter):
- """report result to console"""
+ def render(self, var_dict):
+ return self._fmt.format(**var_dict)
diff --git a/qtip/reporter/console/timeline.j2 b/qtip/reporter/templates/timeline.j2
index 9c18a996..9c18a996 100644
--- a/qtip/reporter/console/timeline.j2
+++ b/qtip/reporter/templates/timeline.j2