You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 52bf161
Browse filesBrowse the repository at this point in the historyBrowse files
ref(core): Measure the performance-collection budget on a monotonic ticker (JAVA-579) (#6101)
* ref(core): Measure the performance-collection budget on a monotonic ticker (JAVA-579)
DefaultCompositePerformanceCollector decided a transaction had been
collecting for 30s by subtracting two options.getDateProvider()
readings. Those are wall-clock on every platform, including Android:
SentryNanotimeDate.nanoTimestamp() returns millisToNanos(unixDateMillis),
not its nanoTime component, so the extra precision that type exists for
never entered this comparison. A device time change therefore ended
collection early or kept it running past the budget.
Each CompositeData now holds a Deadline on a MonotonicTicker. The budget
is not a serialized value, so this only changes when the collector stops.
Two side effects worth review: the 30s boundary is now inclusive, where
the old strict `>` let a sample land exactly at 30s; and
addDataAndCheckTimeout no longer takes the shared clock reading, since
each transaction owns its own deadline. TestMonotonicTicker's field is
now volatile, as the timer thread reads a ticker the test thread
advances.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* changelog
* ref(core): Read the collection ticker from options
Drop the package-private constructor overload that took a
MonotonicTicker and read options.getMonotonicTicker() instead. The test
overrides getMonotonicTicker() on a SentryOptions subclass, as
SentryOptionsTest already does.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -75,6 +75,10 @@
75
75
76
76
- Promote the metrics capture API from experimental to stable ([#6425](https://github.com/getsentry/sentry-java/pull/6425))
77
77
78
+
### Internal
79
+
80
+
- Measure the 30 second performance-collection budget on a monotonic ticker, so that a device time change no longer ends collection early or extends it past the budget ([#6101](https://github.com/getsentry/sentry-java/pull/6101))
0 commit comments