Skip to content

Commit 4a741f0

Browse files
malysclaude
andcommitted
feat(telemetry): keep 2 MiB of trip history instead of 512 KiB
512 KiB held roughly fourteen short trips' tracks, so every new drive evicted older ones and the consumption model lost segments as trips were added (51 to 47 on SWI68). All readers parse off the main thread and the write is atomic; the cost is parse time and memory per read. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 10e5876 commit 4a741f0

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

‎CHANGELOG.md‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,15 @@ All notable changes to this project are documented here. Format follows
66

77
## [Unreleased]
88

9+
### Changed
10+
11+
- **The trip history keeps four times as many tracks.** `EnergyTripHistoryStore`'s default
12+
`maxBytes` goes from 512 KiB to 2 MiB. At about 145 KB per hour of driving, 512 KiB held roughly
13+
fourteen short trips' tracks, so each new drive evicted older tracks and the consumption model's
14+
segment count fell as trips were added (51 to 47 on SWI68, 2026-09-30). One long trip's
15+
4 096-sample track alone did not fit. Every reader parses the file off the main thread and the
16+
write stays atomic, so the cost is parse time and memory per read, not a new failure mode.
17+
918
### Fixed
1019

1120
- **An overnight charge the head unit slept through is a charge.** `ChargeEnergy.plugged` required

‎lib/src/main/java/com/evsuite/hardware/telemetry/EnergyTripHistoryStore.kt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ data class TripHistoryFile(
4343
class EnergyTripHistoryStore(
4444
private val target: File,
4545
private val maxTrips: Int = 200,
46-
private val maxBytes: Int = 512 * 1024,
46+
private val maxBytes: Int = 2 * 1024 * 1024,
4747
private val gson: Gson = Gson(),
4848
) {
4949
/** Trips with whatever tracks survived eviction, newest first. */

0 commit comments

Comments
 (0)