diff options
author | Jose Perez Carranza <jose.perez.carranza@intel.com> | 2016-08-10 10:36:17 -0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-08-17 10:35:43 +0100 |
commit | 6203a77a53fe44dd51f36c40268f26b68ab72d70 (patch) | |
tree | 4d81bf0d7e2e59be266a8cb4a0b38380fee4b19c /meta/lib | |
parent | a191285b97bbd9cff8db833fd94c6a69dd443132 (diff) | |
download | poky-6203a77a53fe44dd51f36c40268f26b68ab72d70.tar.gz |
buildperf: Add support for times without decimal part
Add logic for the cases when the time retrieved does
not have decimal part.
(From OE-Core rev: a6c9e515f8bc590612e3082ab1c4c254711c8e3b)
Signed-off-by: Jose Perez Carranza <jose.perez.carranza@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r-- | meta/lib/oeqa/buildperf/base.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/meta/lib/oeqa/buildperf/base.py b/meta/lib/oeqa/buildperf/base.py index 527563bb0b..1eb21f6813 100644 --- a/meta/lib/oeqa/buildperf/base.py +++ b/meta/lib/oeqa/buildperf/base.py | |||
@@ -244,7 +244,11 @@ class BuildPerfTest(object): | |||
244 | split = strtime.split(':') | 244 | split = strtime.split(':') |
245 | hours = int(split[0]) if len(split) > 2 else 0 | 245 | hours = int(split[0]) if len(split) > 2 else 0 |
246 | mins = int(split[-2]) | 246 | mins = int(split[-2]) |
247 | secs, frac = split[-1].split('.') | 247 | try: |
248 | secs, frac = split[-1].split('.') | ||
249 | except: | ||
250 | secs = split[-1] | ||
251 | frac = '0' | ||
248 | secs = int(secs) | 252 | secs = int(secs) |
249 | microsecs = int(float('0.' + frac) * pow(10, 6)) | 253 | microsecs = int(float('0.' + frac) * pow(10, 6)) |
250 | return timedelta(0, hours*3600 + mins*60 + secs, microsecs) | 254 | return timedelta(0, hours*3600 + mins*60 + secs, microsecs) |