[gnome-continuous-yocto/gnomeostree-3.28-rocko: 1904/8267] buildperf: Add support for times without decimal part
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-continuous-yocto/gnomeostree-3.28-rocko: 1904/8267] buildperf: Add support for times without decimal part
- Date: Sat, 16 Dec 2017 22:28:51 +0000 (UTC)
commit 6203a77a53fe44dd51f36c40268f26b68ab72d70
Author: Jose Perez Carranza <jose perez carranza intel com>
Date: Wed Aug 10 10:36:17 2016 -0500
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>
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 527563b..1eb21f6 100644
--- a/meta/lib/oeqa/buildperf/base.py
+++ b/meta/lib/oeqa/buildperf/base.py
@@ -244,7 +244,11 @@ class BuildPerfTest(object):
split = strtime.split(':')
hours = int(split[0]) if len(split) > 2 else 0
mins = int(split[-2])
- secs, frac = split[-1].split('.')
+ try:
+ secs, frac = split[-1].split('.')
+ except:
+ secs = split[-1]
+ frac = '0'
secs = int(secs)
microsecs = int(float('0.' + frac) * pow(10, 6))
return timedelta(0, hours*3600 + mins*60 + secs, microsecs)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]