Skip to contentSkip to conversation

support/scripts: sort pie charts

PATCH New Thomas De Schampheleire 3 participants 3 messages Jan 2, 2018 – Jan 8, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 support/scripts: sort pie charts

Make sure that the pie charts produced by 'graph-build' and 'graph-size' targets are sorted on the size of each piece of the pie. Otherwise, making visual analysis is difficult, as one needs to look at the legends of each piece and do the sorting manually in their head.

---
 support/scripts/graph-build-time | 2 +-
 support/scripts/size-stats       | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
support/scripts/graph-build-time +1 -1
index 0ba0f2d3a7..9d05f2257a 100755
@@ -184,7 +184,7 @@ def pkg_pie_time_per_package(data, output):
     labels = []
     values = []
     other_value = 0
-    for p in data:
+    for p in sorted(data, key=lambda p: p.get_duration()):
         if p.get_duration() < (total * 0.01):
             other_value += p.get_duration()
         else:
support/scripts/size-stats +1 -1
index 3ff2a1ce18..85e7c1596b 100755
@@ -127,7 +127,7 @@ def draw_graph(pkgsize, outputf):
     labels = []
     values = []
     other_value = 0
-    for (p, sz) in pkgsize.items():
+    for (p, sz) in sorted(pkgsize.items(), key=lambda x: x[1]):
         if sz < (total * 0.01):
             other_value += sz
         else:
Signature · 1 line
2.13.6
#1 lore raw

PATCH 1/1 support/scripts: sort pie charts

Hello,

Quoted 10 lines · Thomas De Schampheleire

Make sure that the pie charts produced by 'graph-build' and 'graph-size' targets are sorted on the size of each piece of the pie. Otherwise, making visual analysis is difficult, as one needs to look at the legends of each piece and do the sorting manually in their head.

---
 support/scripts/graph-build-time | 2 +-
 support/scripts/size-stats       | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Applied to master, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#2 lore raw

PATCH 1/1 support/scripts: sort pie charts

In reply to Thomas De Schampheleire
Quoted 8 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas De Schampheleire <[email protected]> writes:

Make sure that the pie charts produced by 'graph-build' and 'graph-size' targets are sorted on the size of each piece of the pie. Otherwise, making visual analysis is difficult, as one needs to look at the legends of each piece and do the sorting manually in their head.

Committed to 2017.11.x, thanks.

Signature · 1 line
Bye, Peter Korsgaard