mirror of
https://github.com/infiniteCable2/openpilot.git
synced 2026-10-01 03:53:41 +08:00
* Revert "Remove `setproctitle` (#32716)" This reverts commit 9020d1931f4cd72f8162e4402278bdf76e3746f2. * uv lock * old name old-commit-hash: 29b58d4f2fcc982d5c06ed8391e368b1b293a96c
This commit is contained in:
+3
-3
@@ -4,7 +4,7 @@ import os
|
||||
import time
|
||||
from collections import deque
|
||||
|
||||
from openpilot.common.threadname import getthreadname
|
||||
from setproctitle import getproctitle
|
||||
|
||||
from openpilot.system.hardware import PC
|
||||
|
||||
@@ -52,7 +52,7 @@ class Ratekeeper:
|
||||
self._print_delay_threshold = print_delay_threshold
|
||||
self._frame = 0
|
||||
self._remaining = 0.0
|
||||
self._thread_name = getthreadname()
|
||||
self._process_name = getproctitle()
|
||||
self._dts = deque([self._interval], maxlen=100)
|
||||
self._last_monitor_time = time.monotonic()
|
||||
|
||||
@@ -87,7 +87,7 @@ class Ratekeeper:
|
||||
remaining = self._next_frame_time - time.monotonic()
|
||||
self._next_frame_time += self._interval
|
||||
if self._print_delay_threshold is not None and remaining < -self._print_delay_threshold:
|
||||
print(f"{self._thread_name} lagging by {-remaining * 1000:.2f} ms")
|
||||
print(f"{self._process_name} lagging by {-remaining * 1000:.2f} ms")
|
||||
lagged = True
|
||||
self._frame += 1
|
||||
self._remaining = remaining
|
||||
|
||||
Reference in New Issue
Block a user