diff options
Diffstat (limited to 'qtip')
-rw-r--r-- | qtip/collector/transformer/__init__.py | 0 | ||||
-rw-r--r-- | qtip/collector/transformer/base.py | 12 | ||||
-rw-r--r-- | qtip/collector/transformer/timeline.py | 14 | ||||
-rw-r--r-- | qtip/loader/base.py | 7 | ||||
-rw-r--r-- | qtip/reporter/console/__init__.py (renamed from qtip/reporter/console.py) | 3 | ||||
-rw-r--r-- | qtip/reporter/console/timeline.j2 | 8 |
6 files changed, 40 insertions, 4 deletions
diff --git a/qtip/collector/transformer/__init__.py b/qtip/collector/transformer/__init__.py new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/qtip/collector/transformer/__init__.py diff --git a/qtip/collector/transformer/base.py b/qtip/collector/transformer/base.py new file mode 100644 index 00000000..bf38c493 --- /dev/null +++ b/qtip/collector/transformer/base.py @@ -0,0 +1,12 @@ +############################################################################## +# 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 BaseTransformer(object): + """Transform collected performance metrics into required format""" diff --git a/qtip/collector/transformer/timeline.py b/qtip/collector/transformer/timeline.py new file mode 100644 index 00000000..9dd5850c --- /dev/null +++ b/qtip/collector/transformer/timeline.py @@ -0,0 +1,14 @@ +############################################################################## +# 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 +############################################################################## + +from base import BaseTransformer + + +class Timeline(BaseTransformer): + """transform collected metrics into object required by timeline template""" diff --git a/qtip/loader/base.py b/qtip/loader/base.py index 2f5ab67a..d3a7e1d3 100644 --- a/qtip/loader/base.py +++ b/qtip/loader/base.py @@ -15,14 +15,15 @@ import yaml from qtip.base.error import InvalidFormat, NotFound from qtip.base.constant import PropName -ROOT_DIR = 'benchmarks' + +ROOT_DIR = path.join(path.dirname(__file__), path.pardir, path.pardir, + 'benchmarks') class BaseLoader(object): """Abstract class of QTIP benchmark loader""" RELATIVE_PATH = '.' - _paths = [path.join(path.dirname(__file__), path.pardir, path.pardir, - ROOT_DIR)] + _paths = [ROOT_DIR] def __init__(self, name, paths=None): self._file = name diff --git a/qtip/reporter/console.py b/qtip/reporter/console/__init__.py index 136ce358..02d63288 100644 --- a/qtip/reporter/console.py +++ b/qtip/reporter/console/__init__.py @@ -7,7 +7,8 @@ # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## -from base import BaseReporter + +from qtip.reporter.base import BaseReporter class ConsoleReporter(BaseReporter): diff --git a/qtip/reporter/console/timeline.j2 b/qtip/reporter/console/timeline.j2 new file mode 100644 index 00000000..9c18a996 --- /dev/null +++ b/qtip/reporter/console/timeline.j2 @@ -0,0 +1,8 @@ +{% title %} +{% for phase in phases %} +{{ phase.name|upper }}{{ "TIME" }} +{% for cp in phase.checkpoints %} +{{ cp.name }}{{ cp.timestamp}} +{% endfor %} +{% endfor %} +Total: {{ total }} |