Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: don't try to generate all 0 flamegraphs
Browse files Browse the repository at this point in the history
stephenh-axiom-xyz authored and yi-sun committed Jan 12, 2025
1 parent dab9a3a commit 383a4ce
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ci/scripts/metric_unify/flamegraph.py
Original file line number Diff line number Diff line change
@@ -15,6 +15,7 @@ def get_stack_lines(metrics_dict, group_by_kvs, stack_keys, metric_name):
It will write a file with one line each for flamegraph.pl or inferno-flamegraph to consume.
"""
lines = []
non_zero = False

# Process counters
for counter in metrics_dict.get('counter', []):
@@ -42,10 +43,13 @@ def get_stack_lines(metrics_dict, group_by_kvs, stack_keys, metric_name):
stack = ';'.join(stack_values)
value = int(counter['value'])

if value != 0:
non_zero = True

lines.append(f"{stack} {value}")

# Currently cycle tracker does not use gauge
return lines
return lines if non_zero else []


def create_flamegraph(fname, metrics_dict, group_by_kvs, stack_keys, metric_name, reverse=False):

0 comments on commit 383a4ce

Please sign in to comment.