Skip to content

Commit

Permalink
Repair service ratio is negative
Browse files Browse the repository at this point in the history
  • Loading branch information
liuchao authored and xiaochaoren1 committed Dec 5, 2023
1 parent b1bd2f9 commit a71412e
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions app/app/application/l7_flow_tracing.py
Original file line number Diff line number Diff line change
Expand Up @@ -1397,12 +1397,10 @@ def format_selftime(traces, parent_trace, child_ids, uid_index_map):
child_trace = traces[uid_index_map[child_id]]
child_self_time = child_trace["end_time_us"] - child_trace[
"start_time_us"]
if child_self_time > 0:
if child_self_time > 0 and child_self_time <= parent_trace["selftime"]:
parent_trace["selftime"] -= child_self_time
else:
new_child_ids = child_trace.get("childs", [])
return format_selftime(traces, parent_trace, new_child_ids,
uid_index_map)
return


def pruning_trace(response, _id, network_delay_us):
Expand Down

0 comments on commit a71412e

Please sign in to comment.