Repository navigation
docs(time): Steer new measurements at the io.sentry.time clock APIs - #6088
Open
runningcode wants to merge 3 commits into
Open
runningcode wants to merge 3 commits into
runningcode wants to merge 3 commits into
Conversation
📲 Install BuildsAndroid
|
Document on each singleton clock's getInstance() that callers should read the ticker or wall clock off the options object instead, so they get the per-platform implementation rather than pinning themselves to one. Calling JavaMonotonicTicker.getInstance() on Android is the trap worth naming: it stops counting through a device suspend, so intervals spanning a deep sleep come out short. Add an AGENTS.md section so new measurement code reaches for io.sentry.time rather than DateUtils.getCurrentDateTime() or a SentryDateProvider, picks the abstraction by what the number is for, and treats adding a new abstraction as a deliberate step rather than a way around an awkward call site. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
runningcode
force-pushed
the
no/docs-clock-apis
branch
from
November 6, 2026 11:48
864c8cb to
71d977c
Compare
Name the legacy clock interfaces instead of listing their implementations, which also covers ICurrentDateProvider. Drop the table's notes column and the history of why the old types remain, and cut the two rules to a sentence each. The getInstance() Javadoc already carries the detail where callers see it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Drop the paragraph on when getInstance() may still be called directly. Only the options accessors and test support do, so it restated the code. Keep the one reason that matters: JavaMonotonicTicker stops counting while an Android device is suspended. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
runningcode
marked this pull request as ready for review
November 6, 2026 12:09
runningcode
requested review from
0xadam-brown and
romtsn
and removed request for
a team
November 6, 2026 12:09
romtsn
approved these changes
Nov 6, 2026
This branch has not been deployed
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.
📜 Description
Documentation only, no behavior change.
AGENTS.mdgets a "Measuring Time" section: new code that reads a clock usesio.sentry.time, picks the type by what the number is for, and gets the clock fromoptions.getEpochClock()oroptions.getMonotonicTicker().getInstance()methods onJavaMonotonicTicker,SystemEpochClockandAndroidMonotonicTickernow point callers at those accessors.💡 Motivation and Context
io.sentry.timelanded in #6028, #6045 and #6030, but nothing says how to use it. The easy mistake isJavaMonotonicTicker.getInstance()on Android: it works, but stops counting during device suspend, so intervals that span a deep sleep come out short. Most existing clock reads still use the old APIs, so the nearest example is usually the wrong one to copy.💚 How did you test it?
Docs only.
📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
Moving existing call sites onto
io.sentry.timeis the rest of the clock series and stays out of this PR.#skip-changelog