aboutsummaryrefslogtreecommitdiffstats
path: root/yardstick/common
diff options
context:
space:
mode:
authorRoss Brattain <ross.b.brattain@intel.com>2017-08-15 00:56:55 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-08-15 00:56:55 +0000
commit4f842b4a7cedcc5ba89542955bf2b64c3451361d (patch)
treec040e2ecd8706aa7b6cc7f00221a27d222bb5727 /yardstick/common
parent029bbae1bd73dd50e146d069c6080cd0f0064126 (diff)
parentb88e1a41c01a34d08ba3a0e201d0603b35ee4fba (diff)
Merge "Add yardstick report for each task"
Diffstat (limited to 'yardstick/common')
-rw-r--r--yardstick/common/constants.py1
-rw-r--r--yardstick/common/html_template.py60
2 files changed, 61 insertions, 0 deletions
diff --git a/yardstick/common/constants.py b/yardstick/common/constants.py
index f80e10488..fe394fd4d 100644
--- a/yardstick/common/constants.py
+++ b/yardstick/common/constants.py
@@ -91,6 +91,7 @@ LOAD_IMAGES_SCRIPT = get_param('file.load_image_script',
LOAD_IMAGES_SCRIPT = join(REPOS_DIR, LOAD_IMAGES_SCRIPT)
DEFAULT_OUTPUT_FILE = get_param('file.output_file', '/tmp/yardstick.out')
DEFAULT_HTML_FILE = get_param('file.html_file', '/tmp/yardstick.htm')
+REPORTING_FILE = get_param('file.reporting_file', '/tmp/report.html')
# influxDB
INFLUXDB_IP = get_param('influxdb.ip', SERVER_IP)
diff --git a/yardstick/common/html_template.py b/yardstick/common/html_template.py
index 4b46e77a0..f030a2f6c 100644
--- a/yardstick/common/html_template.py
+++ b/yardstick/common/html_template.py
@@ -131,3 +131,63 @@ $(function() {
</body>
</html>"""
+
+report_template = """
+<html>
+ <head>
+ <title>Yardstick Report</title>
+ <link href="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/css\
+/bootstrap.min.css" rel="stylesheet">
+ </head>
+ <div class="content">
+ <h3>Yardstick Report </h3>
+ <hr/>
+ <div>
+
+ <div>Task ID : {{result.task_id}} </div>
+ <div style="margin-top:5px;">Criteria :
+ <font> {{result.criteria}}</font>
+ </div>
+ <hr/>
+
+ <caption>Information</caption>
+ <table class="table table-striped">
+ <tr>
+ <th>#</th>
+ <th>key</th>
+ <th>value</th>
+ </tr>
+ <tbody>
+ {% for key, value in result.info.iteritems() %}
+ <tr>
+ <td>{{ loop.index }}</td>
+ <td>{{key}}</td>
+ <td>{{value}}</td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
+ <hr/>
+
+ <caption>Test Cases</caption>
+ <table class="table table-striped">
+ <tr>
+ <th>#</th>
+ <th>key</th>
+ <th>value</th>
+ </tr>
+ <tbody>
+ {% for key, value in result.testcases.iteritems() %}
+ <tr>
+ <td>{{ loop.index }}</td>
+ <td>{{key}}</td>
+ <td>{{value.criteria}}</td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
+
+ </div>
+ </div>
+</html>
+"""