refactor: store jt808 daily mileage as single metric

This commit is contained in:
lingniu
2026-07-01 06:25:33 +08:00
parent 3d4676adf3
commit 3e19c72915
4 changed files with 127 additions and 55 deletions

View File

@@ -125,12 +125,12 @@ calculation_method = JT808_TOTAL_MILEAGE_DIFF
```
- Store the metric in `vehicle_stat_metric` with
`metric_key = daily_mileage_km`.
`metric_key = daily_mileage_km`; the first and latest GPS total mileage used
for the subtraction stay on the same metric row as calculation source columns.
There is no JT808-specific daily mileage table and no in-memory production
state-store mode. Daily start total, latest total, and derived mileage are all
stored in `vehicle_stat_metric`, so restart recovery does not require a separate
Redis mileage state.
state-store mode. Restart recovery reads the same metric row, so it does not
require a separate Redis mileage state.
### Latest State