PROJECT / 05 / README LINKED NODE / DEVICEHEALTHLAB STATUS / SOURCE ONLY
device health lab
A system health monitor for battery, thermal and performance, built around a sealed MetricValue type that makes a fabricated metric fail to compile.
Project documentation
root@dream:~# fetch device-health-lab/README.md --background
DOCUMENT CHANNEL OPEN / PAGE INTERFACE READYThe type is the policy
Data honesty is usually a convention, which means it survives exactly as long as the developer remembers it. Here it is a type. Nothing reaches the UI as a bare number — it arrives as a MetricValue, and rendering one means handling the case where the platform would not answer.
sealed interface MetricValue {
data class Real(val value: Double, val unit: String) : MetricValue
data class Estimated(val value: Double, val basis: String) : MetricValue
data class RootSourced(val value: Double, val path: String) : MetricValue
data object Unavailable : MetricValue
}
An estimate carries the basis it was derived from. A root-sourced reading carries the sysfs path it came from. Unavailable is a first-class outcome rather than a zero, so an unanswerable question never renders as a confident 0.
Coverage
- Battery health, charge cycles and discharge behaviour over time.
- Thermal zones and throttling events.
- Device and system-performance health sampled on a WorkManager schedule.
- History persisted in Room; preferences in DataStore.