Repository navigation
ios: write iOS's MetricKit reports into the strap log - #2420
Merged
Merged
Conversation
iOS measures every app on the phone and will hand an app its own numbers: about once a day, what it used the day before (foreground and background time, CPU, peak memory, disk writes, hangs, and why it exited — normally, at the CPU or memory limit, by the watchdog, by a crash), and after a crash, a hang, a CPU or disk-write exception or a slow launch, a report about it. NOOP did not subscribe. MetricKitLog registers once at launch and writes one line per report into the strap log (MetricKitLine). Nothing is sent anywhere: iOS gathers the numbers on the phone and the lines stay in the log a person exports by hand. No timer, no file, no network; between reports it costs nothing. The 22 Sep investigation of iOS closing NOOP for background CPU needed crash reports found by hand in Analytics Data; the same facts now arrive in the file a tester already sends. A line says only what iOS reported: a field MetricKit left out is not printed as a zero. Android has no equivalent API, so this is iOS-only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
UtkuDenizAltiok
added a commit
to UtkuDenizAltiok/noop
that referenced
this pull request
Sep 23, 2026
UtkuDenizAltiok
added a commit
to UtkuDenizAltiok/noop
that referenced
this pull request
Sep 28, 2026
…2437 ryanbr#2444), ryanbr#2446 fixed upstream; logs+backup analysed (BACKLOG A background re-score, B ryanbr#2371 answered); fork tidied; build 0ad5ba9 shipped
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does
iOS measures every app on the phone and will hand an app its own numbers through MetricKit: about once a day, what it used the day before (foreground and background time, CPU, peak memory, disk writes, hangs, and why it exited — normally, at the CPU or memory limit, by the watchdog, by a crash), and after a crash, a hang, a CPU or disk-write exception or a slow launch, a report about it. NOOP did not subscribe.
MetricKitLogregisters once at launch and writes one line per report into the strap log (MetricKitLine), for example:Nothing is sent anywhere. iOS gathers the numbers on the phone and delivers them to the app; the lines go only into the strap log a person exports by hand — no telemetry, no network, no file of its own, no timer. Between reports it costs nothing.
Why: on 22 Sep iOS closed NOOP four times during a session for background CPU (
cpu_resource_fatal), and the only evidence was crash reports the tester had to find by hand in Settings → Privacy → Analytics Data. The same facts now arrive in the file testers already send, and the daily line gives battery questions a measured answer.A line says only what iOS reported: a field MetricKit left out is left out of the line, not printed as a zero. Android has no equivalent API, so this is iOS-only.
Type of change
How it was tested
MetricKitLineTests(StrandTests), 4 tests: a full day, a day with nothing reported, a diagnostic line, durations and sizes. With a missing value printed as zero, the "not reported" test fails, and the file restored byte-identical (sha256).6721e3b2; the head is the same diff rebased onto8f064df7, whose newer commits touch none of these files), every step passed: WhoopStore 611 · StrandAnalytics 2048 · StrandImport 327 · doc lint · i18n · parity ledger, ratchet, governance (124) · macOSStrandTests2,121 (only the two locale-dependentTodayCarryOverTests) · iOS build, no warnings in the new files.Checklist
docs/CONTRIBUTING.md— no data leaves the deviceStrand.xcodeproj/) or any secrets/keystores🤖 Generated with Claude Code