-
-
Notifications
You must be signed in to change notification settings - Fork 469
feat(android): Parse memory and GC info from ANR thread dumps #5428
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
Merged
Merged
Changes from 2 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
46f32f2
feat(android): Parse memory and GC info from ANR thread dumps
markushi 9cb9fdf
changelog
markushi d19b7d0
Feed Art stats into a new top level ArtContext
markushi 089d25e
Update Changelog
markushi 7edda13
Update changelog
markushi af52824
Address PR comments
markushi c8f560d
Parse all available timing units
markushi 1493734
Align ArtContext JSON keys with sentry-conventions
markushi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
114 changes: 114 additions & 0 deletions
114
...d-core/src/main/java/io/sentry/android/core/internal/threaddump/ThreadDumpMemoryInfo.java
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,114 @@ | ||
| package io.sentry.android.core.internal.threaddump; | ||
|
|
||
| import org.jetbrains.annotations.ApiStatus; | ||
| import org.jetbrains.annotations.Nullable; | ||
|
|
||
| /** | ||
| * Holds memory and GC metrics parsed from an ANRv2 thread dump. | ||
| * | ||
| * <p>Memory sizes are in bytes. GC times are in milliseconds. | ||
| */ | ||
| @ApiStatus.Internal | ||
| public final class ThreadDumpMemoryInfo { | ||
|
|
||
| private @Nullable Long freeMemoryBytes; | ||
| private @Nullable Long freeMemoryUntilGcBytes; | ||
| private @Nullable Long freeMemoryUntilOOMEBytes; | ||
| private @Nullable Long totalMemoryBytes; | ||
| private @Nullable Long maxMemoryBytes; | ||
|
|
||
| private @Nullable Long totalGcCount; | ||
| private @Nullable Double totalGcTimeMs; | ||
| private @Nullable Long totalBlockingGcCount; | ||
| private @Nullable Double totalBlockingGcTimeMs; | ||
| private @Nullable Long totalPreOomeGcCount; | ||
| private @Nullable Double totalTimeWaitingForGcMs; | ||
|
|
||
| public @Nullable Long getFreeMemoryBytes() { | ||
| return freeMemoryBytes; | ||
| } | ||
|
|
||
| public void setFreeMemoryBytes(final @Nullable Long freeMemoryBytes) { | ||
| this.freeMemoryBytes = freeMemoryBytes; | ||
| } | ||
|
|
||
| public @Nullable Long getFreeMemoryUntilGcBytes() { | ||
| return freeMemoryUntilGcBytes; | ||
| } | ||
|
|
||
| public void setFreeMemoryUntilGcBytes(final @Nullable Long freeMemoryUntilGcBytes) { | ||
| this.freeMemoryUntilGcBytes = freeMemoryUntilGcBytes; | ||
| } | ||
|
|
||
| public @Nullable Long getFreeMemoryUntilOOMEBytes() { | ||
| return freeMemoryUntilOOMEBytes; | ||
| } | ||
|
|
||
| public void setFreeMemoryUntilOOMEBytes(final @Nullable Long freeMemoryUntilOOMEBytes) { | ||
| this.freeMemoryUntilOOMEBytes = freeMemoryUntilOOMEBytes; | ||
| } | ||
|
|
||
| public @Nullable Long getTotalMemoryBytes() { | ||
| return totalMemoryBytes; | ||
| } | ||
|
|
||
| public void setTotalMemoryBytes(final @Nullable Long totalMemoryBytes) { | ||
| this.totalMemoryBytes = totalMemoryBytes; | ||
| } | ||
|
|
||
| public @Nullable Long getMaxMemoryBytes() { | ||
| return maxMemoryBytes; | ||
| } | ||
|
|
||
| public void setMaxMemoryBytes(final @Nullable Long maxMemoryBytes) { | ||
| this.maxMemoryBytes = maxMemoryBytes; | ||
| } | ||
|
|
||
| public @Nullable Long getTotalGcCount() { | ||
| return totalGcCount; | ||
| } | ||
|
|
||
| public void setTotalGcCount(final @Nullable Long totalGcCount) { | ||
| this.totalGcCount = totalGcCount; | ||
| } | ||
|
|
||
| public @Nullable Double getTotalGcTimeMs() { | ||
| return totalGcTimeMs; | ||
| } | ||
|
|
||
| public void setTotalGcTimeMs(final @Nullable Double totalGcTimeMs) { | ||
| this.totalGcTimeMs = totalGcTimeMs; | ||
| } | ||
|
|
||
| public @Nullable Long getTotalBlockingGcCount() { | ||
| return totalBlockingGcCount; | ||
| } | ||
|
|
||
| public void setTotalBlockingGcCount(final @Nullable Long totalBlockingGcCount) { | ||
| this.totalBlockingGcCount = totalBlockingGcCount; | ||
| } | ||
|
|
||
| public @Nullable Double getTotalBlockingGcTimeMs() { | ||
| return totalBlockingGcTimeMs; | ||
| } | ||
|
|
||
| public void setTotalBlockingGcTimeMs(final @Nullable Double totalBlockingGcTimeMs) { | ||
| this.totalBlockingGcTimeMs = totalBlockingGcTimeMs; | ||
| } | ||
|
|
||
| public @Nullable Long getTotalPreOomeGcCount() { | ||
| return totalPreOomeGcCount; | ||
| } | ||
|
|
||
| public void setTotalPreOomeGcCount(final @Nullable Long totalPreOomeGcCount) { | ||
| this.totalPreOomeGcCount = totalPreOomeGcCount; | ||
| } | ||
|
|
||
| public @Nullable Double getTotalTimeWaitingForGcMs() { | ||
| return totalTimeWaitingForGcMs; | ||
| } | ||
|
|
||
| public void setTotalTimeWaitingForGcMs(final @Nullable Double totalTimeWaitingForGcMs) { | ||
| this.totalTimeWaitingForGcMs = totalTimeWaitingForGcMs; | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.