Skip to content

fix(core): Time out performance collection on a monotonic clock - #6739

Merged
runningcode merged 3 commits into
mainfrom
no/perf-collector-monotonic-timeout
Nov 25, 2026
Merged

runningcode merged 3 commits into
mainfrom
no/perf-collector-monotonic-timeout

Conversation

@runningcode

Copy link
Copy Markdown
Contributor

📜 Description

The 30s performance collection timeout in DefaultCompositePerformanceCollector now uses a Deadline on options.getMonotonicTicker() instead of comparing wall-clock readings.

At exactly 30s the collection now times out (Deadline.hasPassed() is inclusive), where it previously needed one tick more.

💡 Motivation and Context

A backward wall-clock step kept collection running past the timeout, and a forward step stopped it early. Found while reviewing #6591, which fixes the sample timestamps but leaves the timeout alone. This only changes how a duration is measured, not any timestamp the SDK sends.

#6589 edits the same run() block; whichever lands second needs a trivial rebase.

💚 How did you test it?

New unit tests step the wall clock forward and backward with TestMonotonicTicker; they fail on main.

📝 Checklist

  • I added GH Issue ID & Linear ID
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.
  • Public API changes reviewed by another Mobile SDK team member or implemented according to the develop docs spec.

🔮 Next steps

🤖 Generated with Claude Code

runningcode and others added 2 commits November 23, 2026 11:21
The 30s collection timeout compared wall-clock readings, so a backward
clock step kept collection running past the timeout and a forward step
stopped it early. Measure it with a Deadline on the options' monotonic
ticker instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the risk: medium PR risk score: medium label Nov 23, 2026
@github-actions

github-actions Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

PR risk: medium

For commit e68f82b.

Main concerns: reach, data sent to Sentry, host performance.

This label is a hint for reviewers, not an approval.

@sentry

sentry Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
SDK Size io.sentry.tests.size 8.65.1 (1) release

⚙️ sentry-android Build Distribution Settings

@runningcode
runningcode marked this pull request as ready for review November 23, 2026 10:36
@runningcode
runningcode requested review from a team and adinauer as code owners November 23, 2026 10:36
@runningcode
runningcode requested review from markushi and romtsn and removed request for a team November 23, 2026 10:36
@github-actions github-actions Bot added risk: medium PR risk score: medium and removed risk: medium PR risk score: medium labels Nov 23, 2026

@markushi markushi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@github-actions github-actions Bot added risk: medium PR risk score: medium and removed risk: medium PR risk score: medium labels Nov 25, 2026
@runningcode
runningcode enabled auto-merge (squash) November 25, 2026 15:11
@runningcode
runningcode merged commit 31ad03f into main Nov 25, 2026
52 checks passed
@runningcode
runningcode deleted the no/perf-collector-monotonic-timeout branch November 25, 2026 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants