[gnome-continuous-yocto/gnomeostree-3.28-rocko: 4261/8267] oeqa.buildperf: extend xml format to contain measurement data
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-continuous-yocto/gnomeostree-3.28-rocko: 4261/8267] oeqa.buildperf: extend xml format to contain measurement data
- Date: Sun, 17 Dec 2017 01:47:19 +0000 (UTC)
commit 4a26ceaecfcb17cbabf4cf9e1c995f0eafc2e41c
Author: Markus Lehtonen <markus lehtonen linux intel com>
Date: Fri Oct 28 10:19:45 2016 +0300
oeqa.buildperf: extend xml format to contain measurement data
Make the xml report format slightly non-standard by incorporating
measurement data into it.
[YOCTO #10590]
(From OE-Core rev: b7164d30fb125ff0c85a2ea508b0f1801aa57f66)
Signed-off-by: Markus Lehtonen <markus lehtonen linux intel com>
Signed-off-by: Ross Burton <ross burton intel com>
Signed-off-by: Richard Purdie <richard purdie linuxfoundation org>
meta/lib/oeqa/buildperf/base.py | 23 ++++++++++++++++++++++-
1 files changed, 22 insertions(+), 1 deletions(-)
---
diff --git a/meta/lib/oeqa/buildperf/base.py b/meta/lib/oeqa/buildperf/base.py
index de0ee40..efbe20c 100644
--- a/meta/lib/oeqa/buildperf/base.py
+++ b/meta/lib/oeqa/buildperf/base.py
@@ -269,6 +269,7 @@ class BuildPerfTestResult(unittest.TextTestResult):
test_cnt = 0
for status, (test, reason) in self.all_results():
+ test_cnt += 1
testcase = ET.SubElement(suite, 'testcase')
testcase.set('classname', test.__module__ + '.' + test.__class__.__name__)
testcase.set('name', test.name)
@@ -287,7 +288,27 @@ class BuildPerfTestResult(unittest.TextTestResult):
result.text = reason
elif status not in ('SUCCESS', 'UNEXPECTED_SUCCESS'):
raise TypeError("BUG: invalid test status '%s'" % status)
- test_cnt += 1
+
+ for data in test.measurements:
+ measurement = ET.SubElement(testcase, data['type'])
+ measurement.set('name', data['name'])
+ measurement.set('legend', data['legend'])
+ vals = data['values']
+ if data['type'] == BuildPerfTestCase.SYSRES:
+ ET.SubElement(measurement, 'time',
+ timestamp=vals['start_time'].isoformat()).text = \
+ str(vals['elapsed_time'].total_seconds())
+ if 'buildstats_file' in vals:
+ ET.SubElement(measurement, 'buildstats_file').text = vals['buildstats_file']
+ attrib = dict((k, str(v)) for k, v in vals['iostat'].items())
+ ET.SubElement(measurement, 'iostat', attrib=attrib)
+ attrib = dict((k, str(v)) for k, v in vals['rusage'].items())
+ ET.SubElement(measurement, 'rusage', attrib=attrib)
+ elif data['type'] == BuildPerfTestCase.DISKUSAGE:
+ ET.SubElement(measurement, 'size').text = str(vals['size'])
+ else:
+ raise TypeError('BUG: unsupported measurement type')
+
suite.set('tests', str(test_cnt))
# Use minidom for pretty-printing
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]