diff options
author | Christopher Larson <chris_larson@mentor.com> | 2016-07-01 13:42:30 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-07-12 23:10:16 +0100 |
commit | 114206fb4c76c335510352f7e85b95b8ae3acc72 (patch) | |
tree | aa53b8c59c4cfbee881a8439764ebbf9c69c11b9 /meta/classes | |
parent | 029e3ebcb2fc603bba264b589cbcfeb0ef963fc8 (diff) | |
download | poky-114206fb4c76c335510352f7e85b95b8ae3acc72.tar.gz |
buildstats-summary: round the floating point percentage
This was rounded in python 2, but python 3 changed the default behavior of /.
We could switch to the same behavior as previous by switching to // rather
than /, but there's value in keeping at least one decimal point, to avoid the
misleading case where it says 0% but the reuse is non-zero.
(From OE-Core rev: 35d36a4d097ce8a0fd0be2f795e3d5052d4f753c)
Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r-- | meta/classes/buildstats-summary.bbclass | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/meta/classes/buildstats-summary.bbclass b/meta/classes/buildstats-summary.bbclass index d73350b940..b86abcc3f1 100644 --- a/meta/classes/buildstats-summary.bbclass +++ b/meta/classes/buildstats-summary.bbclass | |||
@@ -30,7 +30,11 @@ python buildstats_summary () { | |||
30 | header_printed = True | 30 | header_printed = True |
31 | bb.note("Build completion summary:") | 31 | bb.note("Build completion summary:") |
32 | 32 | ||
33 | bb.note(" {0}: {1}% sstate reuse ({2} setscene, {3} scratch)".format(t, 100*len(sstate)/(len(sstate)+len(no_sstate)), len(sstate), len(no_sstate))) | 33 | sstate_count = len(sstate) |
34 | no_sstate_count = len(no_sstate) | ||
35 | total_count = sstate_count + no_sstate_count | ||
36 | bb.note(" {0}: {1:.1f}% sstate reuse({2} setscene, {3} scratch)".format( | ||
37 | t, round(100 * sstate_count / total_count, 1), sstate_count, no_sstate_count)) | ||
34 | } | 38 | } |
35 | addhandler buildstats_summary | 39 | addhandler buildstats_summary |
36 | buildstats_summary[eventmask] = "bb.event.BuildCompleted" | 40 | buildstats_summary[eventmask] = "bb.event.BuildCompleted" |