Skip to content

Commit

Permalink
fix: loose if condition
Browse files Browse the repository at this point in the history
  • Loading branch information
taloric committed Aug 7, 2024
1 parent 56f4d9f commit 3fbfb8d
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions app/app/application/l7_flow_tracing.py
Original file line number Diff line number Diff line change
Expand Up @@ -2792,7 +2792,7 @@ def correct_span_time(flows: dict, host_clock_correction: dict):
"""
for flow in flows:
agent_id = flow.get('vtap_id') # should be agent_id
if host_clock_correction.get(agent_id, 0) > 0:
if host_clock_correction.get(agent_id, 0) != 0:
flow['start_time_us'] += host_clock_correction[agent_id]
flow['end_time_us'] += host_clock_correction[agent_id]

Expand Down Expand Up @@ -3041,10 +3041,6 @@ def calculate_host_clock_correction(self, child: SpanNode,
parent: SpanNode):
if child.agent_id == parent.agent_id:
return
# 对 OTEL signal_source 作为 parent 时无法校准
# for OTEL signal_source, host clock correction is not available
if parent.signal_source == L7_FLOW_SIGNAL_SOURCE_OTEL:
return

start_time_diff = parent.flow['start_time_us'] - child.flow[
'start_time_us']
Expand Down

0 comments on commit 3fbfb8d

Please sign in to comment.