Bug: Provider identifiers don't match store snapshot keys — CPU/Kernel/Load/Disk sections never populate #30

Closed
opened 2026-09-08 14:47:54 +01:00 by gronod · 0 comments
Owner

Purpose

Four telemetry providers register under providerIdentifier strings that SystemTelemetryStore.decodeSnapshot never looks up, so their snapshot dictionaries are silently dropped every sampling pass and the corresponding UI sections show permanent zeros / placeholder text.

Symptoms (observed on Intel MacBook Air, macOS 14)

  • CPU Activity card: bar at 0%, User/System/Idle all 0.0%/0.0%/100%.
  • Kernel & VM Telemetry: all counters 0.
  • System Load & Mach Factor: load1/5/15 all 0.00, Mach Factor 0.00, Active Mach Tasks 0, Active Mach Threads 0.
  • Disk I/O & IOPS: permanently stuck on "Sampling disk I/O metrics...".

Root Cause — identifier mismatches

Provider Emitted providerIdentifier Store lookup in SystemTelemetryStore.swift
Sources/Telemetry/CPU/MMCPULoadProvider.m:52 com.i3omb.macmonitor.telemetry.cpuload line 324: com.i3omb.macmonitor.telemetry.cpu
Sources/Telemetry/Kernel/MMKernelTelemetryProvider.m:33 com.i3omb.macmonitor.telemetry.kernel.counters line 449: com.i3omb.macmonitor.telemetry.kernel
Sources/Telemetry/System/MMLoadAverageProvider.m:19 com.i3omb.macmonitor.telemetry.system.load line 465: com.i3omb.macmonitor.telemetry.systemload
Sources/Telemetry/Storage/MMDiskIOProvider.m:33 com.i3omb.macmonitor.telemetry.storage.io line 477: com.i3omb.macmonitor.telemetry.diskio

MMTelemetryCoordinator.performSamplePass keys the snapshot by provider.providerIdentifier (Sources/Core/MMTelemetryCoordinator.m:156), so these payloads are present but never decoded.

Suggested Fix

  • Establish a single source of truth for provider identifiers — e.g. a shared MMTelemetryKeys.h with MMProviderIDCPULoad etc. constants used by both the provider and the store, eliminating the duplicated string literals.
  • Alternatively align decodeSnapshot lookup keys to the emitted identifiers (single-file fix).
  • Add a regression test that iterates coordinator.registeredProviders, feeds a synthetic snapshot dict keyed by each providerIdentifier, and asserts every key is consumed by decodeSnapshot (guards this entire bug class).

Acceptance Criteria

  • CPU Activity card shows live per-core and aggregate load.
  • Kernel & VM Telemetry shows live ctx-switch/syscall/page-fault rates.
  • System Load shows real load averages, Mach factor, task/thread counts.
  • Disk I/O lists volumes with live B/s and IOPS.
  • Historical Trends charts begin populating once real values flow (downstream verification).

Dependencies

  • None — but see companion issue for the per-field key drift that must also be resolved for these sections to show correct values.
### Purpose Four telemetry providers register under `providerIdentifier` strings that `SystemTelemetryStore.decodeSnapshot` never looks up, so their snapshot dictionaries are silently dropped every sampling pass and the corresponding UI sections show permanent zeros / placeholder text. ### Symptoms (observed on Intel MacBook Air, macOS 14) - **CPU Activity** card: bar at 0%, User/System/Idle all 0.0%/0.0%/100%. - **Kernel & VM Telemetry**: all counters 0. - **System Load & Mach Factor**: load1/5/15 all 0.00, Mach Factor 0.00, Active Mach Tasks 0, Active Mach Threads 0. - **Disk I/O & IOPS**: permanently stuck on "Sampling disk I/O metrics...". ### Root Cause — identifier mismatches | Provider | Emitted `providerIdentifier` | Store lookup in `SystemTelemetryStore.swift` | |---|---|---| | `Sources/Telemetry/CPU/MMCPULoadProvider.m:52` | `com.i3omb.macmonitor.telemetry.cpuload` | line 324: `com.i3omb.macmonitor.telemetry.cpu` | | `Sources/Telemetry/Kernel/MMKernelTelemetryProvider.m:33` | `com.i3omb.macmonitor.telemetry.kernel.counters` | line 449: `com.i3omb.macmonitor.telemetry.kernel` | | `Sources/Telemetry/System/MMLoadAverageProvider.m:19` | `com.i3omb.macmonitor.telemetry.system.load` | line 465: `com.i3omb.macmonitor.telemetry.systemload` | | `Sources/Telemetry/Storage/MMDiskIOProvider.m:33` | `com.i3omb.macmonitor.telemetry.storage.io` | line 477: `com.i3omb.macmonitor.telemetry.diskio` | `MMTelemetryCoordinator.performSamplePass` keys the snapshot by `provider.providerIdentifier` (`Sources/Core/MMTelemetryCoordinator.m:156`), so these payloads are present but never decoded. ### Suggested Fix - Establish a single source of truth for provider identifiers — e.g. a shared `MMTelemetryKeys.h` with `MMProviderIDCPULoad` etc. constants used by both the provider and the store, eliminating the duplicated string literals. - Alternatively align `decodeSnapshot` lookup keys to the emitted identifiers (single-file fix). - Add a regression test that iterates `coordinator.registeredProviders`, feeds a synthetic snapshot dict keyed by each `providerIdentifier`, and asserts every key is consumed by `decodeSnapshot` (guards this entire bug class). ### Acceptance Criteria - [ ] CPU Activity card shows live per-core and aggregate load. - [ ] Kernel & VM Telemetry shows live ctx-switch/syscall/page-fault rates. - [ ] System Load shows real load averages, Mach factor, task/thread counts. - [ ] Disk I/O lists volumes with live B/s and IOPS. - [ ] Historical Trends charts begin populating once real values flow (downstream verification). ### Dependencies - None — but see companion issue for the per-field key drift that must also be resolved for these sections to show *correct* values.
gronod added this to the M6: Bugfix & Stability milestone 2026-09-08 14:47:54 +01:00
gronod added the Bug/BackendKind/Bug
Priority
Critical
1
Project/Antigravity
labels 2026-09-08 14:48:01 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: gronod/MacMonitor#30