diff options
author | Markus Lehtonen <markus.lehtonen@linux.intel.com> | 2016-06-23 18:43:33 +0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-07-01 16:08:52 +0100 |
commit | e9f18e63220e452f2b0c878998e57d944ae83980 (patch) | |
tree | 26aa5f61ac47e0639331ac9e915e691c5349d4b3 /meta | |
parent | e6004582454d8c6a18f617c12e6e408ded5be8df (diff) | |
download | openembedded-core-e9f18e63220e452f2b0c878998e57d944ae83980.tar.gz openembedded-core-e9f18e63220e452f2b0c878998e57d944ae83980.tar.bz2 openembedded-core-e9f18e63220e452f2b0c878998e57d944ae83980.zip |
oe-build-perf-test: implement --globalres-file option
Using this option the script appends test results into a 'global results
file'. A CSV-formatted output of the results. This option is to provide
compatibility with the old build-perf-test.sh.
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/lib/oeqa/buildperf/base.py | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/meta/lib/oeqa/buildperf/base.py b/meta/lib/oeqa/buildperf/base.py index e10cbf4572..527563bb0b 100644 --- a/meta/lib/oeqa/buildperf/base.py +++ b/meta/lib/oeqa/buildperf/base.py @@ -152,6 +152,38 @@ class BuildPerfTestRunner(object): os.makedirs(os.path.dirname(tgt_dir)) shutil.copytree(src_dir, tgt_dir) + def update_globalres_file(self, filename): + """Write results to globalres csv file""" + if self.repo: + git_tag_rev = self.repo.run_cmd(['describe', self.git_rev]) + else: + git_tag_rev = self.git_rev + times = [] + sizes = [] + for test in self.results['tests'].values(): + for measurement in test['measurements']: + res_type = measurement['type'] + values = measurement['values'] + if res_type == BuildPerfTest.SYSRES: + e_sec = values['elapsed_time'].total_seconds() + times.append('{:d}:{:02d}:{:.2f}'.format( + int(e_sec / 3600), + int((e_sec % 3600) / 60), + e_sec % 60)) + elif res_type == BuildPerfTest.DISKUSAGE: + sizes.append(str(values['size'])) + else: + log.warning("Unable to handle '%s' values in " + "globalres.log", res_type) + + log.debug("Writing globalres log to %s", filename) + with open(filename, 'a') as fobj: + fobj.write('{},{}:{},{},'.format(self.results['tester_host'], + self.results['git_branch'], + self.results['git_revision'], + git_tag_rev)) + fobj.write(','.join(times + sizes) + '\n') + def perf_test_case(obj): """Decorator for adding test classes""" |