Skip to content

Commit

Permalink
address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
CRobeck committed Aug 9, 2024
1 parent d86ef74 commit 2336fb6
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions third_party/proton/proton/viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,11 +187,15 @@ def parse(metrics, filename, include, exclude, threshold, depth, format):
# TODO: generalize to support multiple metrics, not just the first one
gf = filter_frames(gf, include, exclude, threshold, metrics[0])
print(gf.tree(metric_column=metrics, expand_name=True, depth=depth, render_header=False))
if (f"bytes (inc)" in metrics):
byte_values = gf.dataframe[f"bytes (inc)"].values
min_byte_value = np.nanmin(byte_values)
if (min_byte_value < 0):
print("Warning: Negative byte values detected, this is usually the result of a datatype overflow\n")
emitWarnings(gf, metrics)


def emitWarnings(gf, metrics):
if "bytes (inc)" in metrics:
byte_values = gf.dataframe["bytes (inc)"].values
min_byte_value = np.nanmin(byte_values)
if min_byte_value < 0:
print("Warning: Negative byte values detected, this is usually the result of a datatype overflow\n")


def show_metrics(file_name):
Expand Down

0 comments on commit 2336fb6

Please sign in to comment.