pull/32719/head
Shane Smiskol 11 months ago
parent 871fd18a47
commit 9c6e04977b
  1. 4
      selfdrive/debug/internal/qlog_size.py

@ -13,7 +13,6 @@ MIN_SIZE = 0.5 # Percent size of total to show as separate entry
def make_pie(msgs, typ):
msgs_by_type = defaultdict(list)
for m in msgs:
msgs_by_type[m.which()].append(m.as_builder().to_bytes())
@ -21,11 +20,10 @@ def make_pie(msgs, typ):
length_by_type = {k: len(b"".join(v)) for k, v in msgs_by_type.items()}
compressed_length_by_type = {k: len(bz2.compress(b"".join(v))) for k, v in msgs_by_type.items()}
total = sum(compressed_length_by_type.values())
real_total = len(bz2.compress(b"".join([m.as_builder().to_bytes() for m in msgs])))
uncompressed_total = len(b"".join([m.as_builder().to_bytes() for m in msgs]))
total = sum(compressed_length_by_type.values())
sizes = sorted(compressed_length_by_type.items(), key=lambda kv: kv[1])
print("name - comp. size (uncomp. size)")

Loading…
Cancel
Save