Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion inference/core/interfaces/stream/watchdog.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,12 @@ def compute_events_latency(
earlier_event: Optional[ModelActivityEvent],
later_event: Optional[ModelActivityEvent],
) -> Optional[float]:
if not are_events_compatible(events=[earlier_event, later_event]):
# Inline and optimize are_events_compatible for this specific call to reduce function-call overhead
if (
earlier_event is None
or later_event is None
or earlier_event.frame_id != later_event.frame_id
):
return None
return (later_event.event_timestamp - earlier_event.event_timestamp).total_seconds()

Expand Down
Loading