Skip to content

Commit

Permalink
Merge pull request #2117 from bugsnag/lemnik/synth-event-cleanup
Browse files Browse the repository at this point in the history
Don't report PSS/RSS to events when they are <=0
  • Loading branch information
lemnik authored Dec 5, 2024
2 parents c73bb08 + 122e9ab commit 30f7eb7
Showing 1 changed file with 16 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,23 +59,25 @@ internal class EventSynthesizer(
newEvent: Event,
appExitInfo: ApplicationExitInfo
) {
newEvent.addMetadata("exitinfo", "description", appExitInfo.description)
newEvent.addMetadata("exitInfo", "Description", appExitInfo.description)
newEvent.addMetadata(
"exitinfo",
"importance",
"exitInfo",
"Importance",
importanceDescriptionOf(appExitInfo)
)
newEvent.addMetadata(
"exitinfo", "Proportional Set Size (PSS)", "${appExitInfo.pss} kB"
)
newEvent.addMetadata(
"exitinfo", "Resident Set Size (RSS)", "${appExitInfo.rss} kB"
)
}

companion object {
const val IMPORTANCE_EMPTY = 500
const val IMPORTANCE_CANT_SAVE_STATE_PRE_26 = 170
const val IMPORTANCE_TOP_SLEEPING_PRE_28 = 150
val pss = appExitInfo.pss
if (pss > 0) {
newEvent.addMetadata(
"exitInfo", "Proportional Set Size (PSS)", "$pss kB"
)
}

val rss = appExitInfo.rss
if (rss > 0) {
newEvent.addMetadata(
"exitInfo", "Resident Set Size (RSS)", "$rss kB"
)
}
}
}

0 comments on commit 30f7eb7

Please sign in to comment.