Skip to content

Commit

Permalink
Merge pull request #1655 from bugsnag/PLAT-8170-max-threads
Browse files Browse the repository at this point in the history
Allow max threads to be configured via the manifest
  • Loading branch information
kstenerud authored Apr 14, 2022
2 parents 03840c7 + d2eb6f4 commit baef56a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ class ManifestConfigLoaderTest {
assertEquals(maxBreadcrumbs, 50)
assertEquals(maxPersistedEvents, 32)
assertEquals(maxPersistedSessions, 128)
assertEquals(maxReportedThreads, 200)
assertTrue(sendLaunchCrashesSynchronously)
@Suppress("DEPRECATION")
assertEquals(launchCrashThresholdMs, 5000)
Expand Down Expand Up @@ -86,6 +87,7 @@ class ManifestConfigLoaderTest {
putInt("com.bugsnag.android.MAX_BREADCRUMBS", 75)
putInt("com.bugsnag.android.MAX_PERSISTED_EVENTS", 52)
putInt("com.bugsnag.android.MAX_PERSISTED_SESSIONS", 64)
putInt("com.bugsnag.android.MAX_REPORTED_THREADS", 100)
putInt("com.bugsnag.android.LAUNCH_DURATION_MILLIS", 7000)
putBoolean("com.bugsnag.android.SEND_LAUNCH_CRASHES_SYNCHRONOUSLY", false)
putString("com.bugsnag.android.APP_TYPE", "react-native")
Expand Down Expand Up @@ -120,6 +122,7 @@ class ManifestConfigLoaderTest {
assertEquals(maxBreadcrumbs, 75)
assertEquals(maxPersistedEvents, 52)
assertEquals(maxPersistedSessions, 64)
assertEquals(maxReportedThreads, 100)
@Suppress("DEPRECATION")
assertEquals(launchCrashThresholdMs, 7000)
assertEquals(launchDurationMillis, 7000)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ internal class ManifestConfigLoader {
private const val MAX_BREADCRUMBS = "$BUGSNAG_NS.MAX_BREADCRUMBS"
private const val MAX_PERSISTED_EVENTS = "$BUGSNAG_NS.MAX_PERSISTED_EVENTS"
private const val MAX_PERSISTED_SESSIONS = "$BUGSNAG_NS.MAX_PERSISTED_SESSIONS"
private const val MAX_REPORTED_THREADS = "$BUGSNAG_NS.MAX_REPORTED_THREADS"
private const val LAUNCH_CRASH_THRESHOLD_MS = "$BUGSNAG_NS.LAUNCH_CRASH_THRESHOLD_MS"
private const val LAUNCH_DURATION_MILLIS = "$BUGSNAG_NS.LAUNCH_DURATION_MILLIS"
private const val SEND_LAUNCH_CRASHES_SYNCHRONOUSLY = "$BUGSNAG_NS.SEND_LAUNCH_CRASHES_SYNCHRONOUSLY"
Expand Down Expand Up @@ -77,6 +78,7 @@ internal class ManifestConfigLoader {
maxBreadcrumbs = data.getInt(MAX_BREADCRUMBS, maxBreadcrumbs)
maxPersistedEvents = data.getInt(MAX_PERSISTED_EVENTS, maxPersistedEvents)
maxPersistedSessions = data.getInt(MAX_PERSISTED_SESSIONS, maxPersistedSessions)
maxReportedThreads = data.getInt(MAX_REPORTED_THREADS, maxReportedThreads)
launchDurationMillis = data.getInt(
LAUNCH_CRASH_THRESHOLD_MS,
launchDurationMillis.toInt()
Expand Down

0 comments on commit baef56a

Please sign in to comment.