refactor: store jt808 mileage as metric diff

This commit is contained in:
lingniu
2026-07-01 02:32:46 +08:00
parent a5f5cc94ee
commit b94780b48c
12 changed files with 73 additions and 40 deletions

View File

@@ -12,6 +12,7 @@ The JT808 daily-mileage value is calculated from the GPS total mileage reported
```text
daily_mileage_km = last_total_mileage_km - first_total_mileage_km
calculation_method = JT808_TOTAL_MILEAGE_DIFF
```
The metric is saved only after at least two ordered JT808 location points with valid `total_mileage_km` have been received for the same vehicle and local day. If the difference is negative, no metric row is saved for that state update.