Files
managed-portal/managed/people_flow_project/docs/plans/2026-04-08-rtsp-heartbeat-logging.md
2026-04-27 10:04:36 +08:00

1.4 KiB

RTSP Heartbeat Logging Implementation Plan

For Claude: REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task.

Goal: Add one-line RTSP heartbeat logs every 60 seconds so operators can monitor progress during long windows.

Architecture: Extend the RTSP loop with lightweight heartbeat state. Reuse the existing live stats builder and print one compact log line every 60 seconds after sampled frames are processed.

Tech Stack: Python, dataclasses, OpenCV, existing people-flow pipeline


Task 1: Add heartbeat state and log output

Files:

  • Modify: /Users/zxmacmini1/Documents/人流检测/people_flow_project/src/people_flow/pipeline.py

Step 1: Track heartbeat timing

  • Store the process start time.
  • Store the next heartbeat deadline.
  • Store the last successful processed timestamp.

Step 2: Print one-line heartbeat logs

  • Reuse current live stats.
  • Include runtime, window index, frame count, totals, demographics, unknown count, and last processed timestamp.

Step 3: Keep the logging cadence stable

  • Emit at most one heartbeat per 60 seconds.
  • Do not log on every frame.

Task 2: Validate and synchronize

Files:

  • No additional files required

Step 1: Run compile checks

Run: python3 -m compileall main.py src Expected: PASS

Step 2: Sync to remote host

  • Replace the remote project with the updated local copy.
  • Keep the existing remote backup intact.