From e69a46a77854fac1169a09e0c5b70fa4b972255a Mon Sep 17 00:00:00 2001 From: Markus Lehtonen Date: Mon, 29 Aug 2016 22:48:27 +0300 Subject: oeqa.buildperf: measure io stat Add data from /proc//io to system resource measurements. Signed-off-by: Markus Lehtonen Signed-off-by: Richard Purdie --- meta/lib/oeqa/buildperf/base.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/meta/lib/oeqa/buildperf/base.py b/meta/lib/oeqa/buildperf/base.py index 5987bfbe4a..95a0abfa5d 100644 --- a/meta/lib/oeqa/buildperf/base.py +++ b/meta/lib/oeqa/buildperf/base.py @@ -340,6 +340,11 @@ class BuildPerfTestCase(unittest.TestCase): ret = runCmd2(cmd, **kwargs) etime = datetime.now() - start_time rusage_struct = resource.getrusage(resource.RUSAGE_CHILDREN) + iostat = {} + with open('/proc/{}/io'.format(os.getpid())) as fobj: + for line in fobj.readlines(): + key, val = line.split(':') + iostat[key] = int(val) rusage = {} # Skip unused fields, (i.e. 'ru_ixrss', 'ru_idrss', 'ru_isrss', # 'ru_nswap', 'ru_msgsnd', 'ru_msgrcv' and 'ru_nsignals') @@ -350,7 +355,8 @@ class BuildPerfTestCase(unittest.TestCase): data_q.put({'ret': ret, 'start_time': start_time, 'elapsed_time': etime, - 'rusage': rusage}) + 'rusage': rusage, + 'iostat': iostat}) except Exception as err: data_q.put(err) @@ -378,7 +384,8 @@ class BuildPerfTestCase(unittest.TestCase): 'legend': legend} measurement['values'] = {'start_time': data['start_time'], 'elapsed_time': etime, - 'rusage': data['rusage']} + 'rusage': data['rusage'], + 'iostat': data['iostat']} self.measurements.append(measurement) # Append to 'times' array for globalres log -- cgit v1.2.3