summaryrefslogtreecommitdiff
path: root/meta/lib/oeqa
diff options
context:
space:
mode:
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>2016-10-28 10:19:45 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-01-23 12:03:59 +0000
commitb7164d30fb125ff0c85a2ea508b0f1801aa57f66 (patch)
tree14f9c4af0c228b226339f175baaaa5d447445dc0 /meta/lib/oeqa
parent21ae1c491b93675254b7733640662b566ed76f98 (diff)
downloadopenembedded-core-b7164d30fb125ff0c85a2ea508b0f1801aa57f66.tar.gz
openembedded-core-b7164d30fb125ff0c85a2ea508b0f1801aa57f66.tar.bz2
openembedded-core-b7164d30fb125ff0c85a2ea508b0f1801aa57f66.zip
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] Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'meta/lib/oeqa')
-rw-r--r--meta/lib/oeqa/buildperf/base.py23
1 files changed, 22 insertions, 1 deletions
diff --git a/meta/lib/oeqa/buildperf/base.py b/meta/lib/oeqa/buildperf/base.py
index de0ee40a23..efbe20c500 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