-
-
Notifications
You must be signed in to change notification settings - Fork 455
Profiling - Deduplication and cleanup #4681
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: feat/continuous-profiling-02
Are you sure you want to change the base?
Profiling - Deduplication and cleanup #4681
Conversation
…with cross platform frameworks
🚨 Detected changes in high risk code 🚨High-risk code has higher potential to break the SDK and may be hard to test. To prevent severe bugs, apply the rollout process for releasing such changes and be extra careful when changing and reviewing these files:
|
Instructions and example for changelogPlease add an entry to Example: ## Unreleased
- Profiling - Deduplication and cleanup ([#4681](https://github.com/getsentry/sentry-java/pull/4681)) If none of the above apply, you can opt out of this check by adding |
🚨 Detected changes in high risk code 🚨High-risk code has higher potential to break the SDK and may be hard to test. To prevent severe bugs, apply the rollout process for releasing such changes and be extra careful when changing and reviewing these files:
|
Performance metrics 🚀
|
Revision | Plain | With Sentry | Diff |
---|---|---|---|
d6f8356 | 392.08 ms | 454.42 ms | 62.34 ms |
066d89d | 377.51 ms | 434.20 ms | 56.69 ms |
7dcbbbd | 459.22 ms | 509.85 ms | 50.62 ms |
App size
Revision | Plain | With Sentry | Diff |
---|---|---|---|
d6f8356 | 1.58 MiB | 2.09 MiB | 521.68 KiB |
066d89d | 1.58 MiB | 2.09 MiB | 521.85 KiB |
7dcbbbd | 1.58 MiB | 2.09 MiB | 521.68 KiB |
…deduplicate stacks
…entry-java into feat/continuous-profiling-03
🚨 Detected changes in high risk code 🚨High-risk code has higher potential to break the SDK and may be hard to test. To prevent severe bugs, apply the rollout process for releasing such changes and be extra careful when changing and reviewing these files:
|
🚨 Detected changes in high risk code 🚨High-risk code has higher potential to break the SDK and may be hard to test. To prevent severe bugs, apply the rollout process for releasing such changes and be extra careful when changing and reviewing these files:
|
@sentry review |
cursor review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ Bugbot reviewed your changes and found no bugs!
public static final String POST_CONTEXT = "post_context"; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (o == null || getClass() != o.getClass()) return false; | ||
SentryStackFrame that = (SentryStackFrame) o; | ||
return Objects.equals(preContext, that.preContext) | ||
&& Objects.equals(postContext, that.postContext) | ||
&& Objects.equals(vars, that.vars) | ||
&& Objects.equals(framesOmitted, that.framesOmitted) | ||
&& Objects.equals(filename, that.filename) | ||
&& Objects.equals(function, that.function) | ||
&& Objects.equals(module, that.module) | ||
&& Objects.equals(lineno, that.lineno) | ||
&& Objects.equals(colno, that.colno) | ||
&& Objects.equals(absPath, that.absPath) | ||
&& Objects.equals(contextLine, that.contextLine) | ||
&& Objects.equals(inApp, that.inApp) | ||
&& Objects.equals(_package, that._package) | ||
&& Objects.equals(_native, that._native) | ||
&& Objects.equals(platform, that.platform) | ||
&& Objects.equals(imageAddr, that.imageAddr) | ||
&& Objects.equals(symbolAddr, that.symbolAddr) | ||
&& Objects.equals(instructionAddr, that.instructionAddr) | ||
&& Objects.equals(addrMode, that.addrMode) | ||
&& Objects.equals(symbol, that.symbol) | ||
&& Objects.equals(unknown, that.unknown) | ||
&& Objects.equals(rawFunction, that.rawFunction) | ||
&& Objects.equals(lock, that.lock); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash( | ||
preContext, | ||
postContext, | ||
vars, | ||
framesOmitted, | ||
filename, | ||
function, | ||
module, | ||
lineno, | ||
colno, | ||
absPath, | ||
contextLine, | ||
inApp, | ||
_package, | ||
_native, | ||
platform, | ||
imageAddr, | ||
symbolAddr, | ||
instructionAddr, | ||
addrMode, | ||
symbol, | ||
unknown, | ||
rawFunction, | ||
lock); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The vars
field is documented as Map<String, String>
in the class comment but the actual field type has changed to Map<String, Object>
according to the repository context. This mismatch could lead to confusion. The equals and hashCode methods should exclude mutable fields that can change during the object's lifetime, but here vars
is included which may cause issues if the map is modified after the object's hash is computed.
Did we get this right? 👍 / 👎 to inform future reviews.
import java.util.List; | ||
import java.util.Map; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The frame deduplication using HashMap
with SentryStackFrame
as key relies on the newly added equals
/hashCode
methods. However, if any of the frame fields are mutable and change after being used as a key, this could lead to inconsistent behavior. Consider making the frame objects immutable after creation or using a different deduplication strategy.
Did we get this right? 👍 / 👎 to inform future reviews.
🚨 Detected changes in high risk code 🚨High-risk code has higher potential to break the SDK and may be hard to test. To prevent severe bugs, apply the rollout process for releasing such changes and be extra careful when changing and reviewing these files:
|
📜 Description
Follow-up of: #4576
Fixes comments from previous PRs
Fixes method timing sent to sentry by not aggregating JFR events
Fixes RateLimiter Handling for
profile_chunk
andprofile_chunk_ui
💡 Motivation and Context
💚 How did you test it?
📝 Checklist
sendDefaultPII
is enabled.🔮 Next steps