From b5338a69a6e8a218baa13ad76eea51f4662e84d2 Mon Sep 17 00:00:00 2001 From: Jamie Lynch Date: Tue, 28 May 2024 14:59:14 +0100 Subject: [PATCH] refactor: remove perf info field --- .../IntegrationTestRuleExtensions.kt | 8 -------- .../gating/SessionSanitizerFacade.kt | 19 +++++++++++++++--- .../embracesdk/injection/SessionModule.kt | 2 -- .../embracesdk/payload/SessionMessage.kt | 6 ------ .../message/V1PayloadMessageCollator.kt | 20 +++---------------- .../message/V2PayloadMessageCollator.kt | 18 ++--------------- .../EmbraceGatingServiceV1PayloadTest.kt | 18 +++++------------ .../embracesdk/FakeBackgroundActivity.kt | 4 ---- .../embracesdk/SessionSanitizerFacadeTest.kt | 14 ++++++------- .../payload/BackgroundActivityMessageTest.kt | 10 +--------- .../embracesdk/payload/SessionMessageTest.kt | 3 --- .../session/PayloadFactoryBaTest.kt | 5 ----- .../session/PayloadFactorySessionTest.kt | 4 ---- .../embracesdk/session/SessionHandlerTest.kt | 5 ----- .../session/V1PayloadMessageCollatorTest.kt | 3 --- .../session/message/PayloadFactoryImplTest.kt | 3 --- .../message/V2PayloadMessageCollatorTest.kt | 4 ---- .../bg_activity_message_expected.json | 6 ------ .../resources/session_message_expected.json | 6 ------ .../test/resources/v1_session_expected.json | 6 ------ 20 files changed, 33 insertions(+), 131 deletions(-) diff --git a/embrace-android-sdk/src/integrationTest/kotlin/io/embrace/android/embracesdk/IntegrationTestRuleExtensions.kt b/embrace-android-sdk/src/integrationTest/kotlin/io/embrace/android/embracesdk/IntegrationTestRuleExtensions.kt index 736a189205..894ebd7bfa 100644 --- a/embrace-android-sdk/src/integrationTest/kotlin/io/embrace/android/embracesdk/IntegrationTestRuleExtensions.kt +++ b/embrace-android-sdk/src/integrationTest/kotlin/io/embrace/android/embracesdk/IntegrationTestRuleExtensions.kt @@ -211,10 +211,6 @@ internal fun verifySessionHappened(message: SessionMessage) { internal fun verifySessionMessage(sessionMessage: SessionMessage) { assertNotNull(sessionMessage.session) - - if (sessionMessage.session.messageType == "en") { - assertNotNull(sessionMessage.performanceInfo) - } } internal fun verifyBgActivityHappened(message: SessionMessage) { @@ -224,10 +220,6 @@ internal fun verifyBgActivityHappened(message: SessionMessage) { internal fun verifyBgActivityMessage(message: SessionMessage) { assertNotNull(message.session) - - if (message.session.messageType == "en") { - assertNotNull(message.performanceInfo) - } } private const val CHECK_INTERVAL_MS: Int = 10 diff --git a/embrace-android-sdk/src/main/java/io/embrace/android/embracesdk/gating/SessionSanitizerFacade.kt b/embrace-android-sdk/src/main/java/io/embrace/android/embracesdk/gating/SessionSanitizerFacade.kt index 914215e358..889a4ce5e8 100644 --- a/embrace-android-sdk/src/main/java/io/embrace/android/embracesdk/gating/SessionSanitizerFacade.kt +++ b/embrace-android-sdk/src/main/java/io/embrace/android/embracesdk/gating/SessionSanitizerFacade.kt @@ -1,6 +1,7 @@ package io.embrace.android.embracesdk.gating import io.embrace.android.embracesdk.internal.payload.EnvelopeMetadata +import io.embrace.android.embracesdk.internal.payload.EnvelopeResource import io.embrace.android.embracesdk.payload.SessionMessage internal class SessionSanitizerFacade( @@ -10,14 +11,13 @@ internal class SessionSanitizerFacade( fun getSanitizedMessage(): SessionMessage { val sanitizedSession = SessionSanitizer(sessionMessage.session, components).sanitize() - val sanitizedPerformanceInfo = PerformanceInfoSanitizer(sessionMessage.performanceInfo, components).sanitize() val sanitizedSpans = SpanSanitizer(sessionMessage.spans, components).sanitize() return sessionMessage.copy( session = sanitizedSession, - performanceInfo = sanitizedPerformanceInfo, spans = sanitizedSpans, - metadata = sanitizeMetadata(components) + metadata = sanitizeMetadata(components), + resource = sanitizeResource(components) ) } @@ -31,6 +31,19 @@ internal class SessionSanitizerFacade( return sessionMessage.metadata } + private fun sanitizeResource(enabledComponents: Set): EnvelopeResource { + if (sessionMessage.resource == null) { + return EnvelopeResource() + } + if (!shouldSendCurrentDiskUsage(enabledComponents)) { + return sessionMessage.resource.copy(diskTotalCapacity = null) + } + return sessionMessage.resource + } + + private fun shouldSendCurrentDiskUsage(enabledComponents: Set) = + enabledComponents.contains(SessionGatingKeys.PERFORMANCE_CURRENT_DISK_USAGE) + private fun shouldSendUserPersonas(enabledComponents: Set) = enabledComponents.contains(SessionGatingKeys.USER_PERSONAS) } diff --git a/embrace-android-sdk/src/main/java/io/embrace/android/embracesdk/injection/SessionModule.kt b/embrace-android-sdk/src/main/java/io/embrace/android/embracesdk/injection/SessionModule.kt index 931355d8d4..43229f31be 100644 --- a/embrace-android-sdk/src/main/java/io/embrace/android/embracesdk/injection/SessionModule.kt +++ b/embrace-android-sdk/src/main/java/io/embrace/android/embracesdk/injection/SessionModule.kt @@ -49,7 +49,6 @@ internal class SessionModuleImpl( dataContainerModule.eventService, customerLogModule.logMessageService, initModule.internalErrorService, - dataContainerModule.performanceInfoService, dataCaptureServiceModule.webviewService, nativeModule.nativeThreadSamplerService, androidServicesModule.preferencesService, @@ -70,7 +69,6 @@ internal class SessionModuleImpl( payloadModule.sessionEnvelopeSource, dataContainerModule.eventService, customerLogModule.logMessageService, - dataContainerModule.performanceInfoService, nativeModule.nativeThreadSamplerService, androidServicesModule.preferencesService, openTelemetryModule.spanRepository, diff --git a/embrace-android-sdk/src/main/java/io/embrace/android/embracesdk/payload/SessionMessage.kt b/embrace-android-sdk/src/main/java/io/embrace/android/embracesdk/payload/SessionMessage.kt index 7f52fbaac9..fcdcd7ed4e 100644 --- a/embrace-android-sdk/src/main/java/io/embrace/android/embracesdk/payload/SessionMessage.kt +++ b/embrace-android-sdk/src/main/java/io/embrace/android/embracesdk/payload/SessionMessage.kt @@ -20,12 +20,6 @@ internal data class SessionMessage @JvmOverloads internal constructor( @Json(name = "s") val session: Session, - /** - * The device's performance info, such as power, cpu, network. - */ - @Json(name = "p") - val performanceInfo: PerformanceInfo? = null, - @Json(name = "spans") val spans: List? = null, diff --git a/embrace-android-sdk/src/main/java/io/embrace/android/embracesdk/session/message/V1PayloadMessageCollator.kt b/embrace-android-sdk/src/main/java/io/embrace/android/embracesdk/session/message/V1PayloadMessageCollator.kt index 744712f491..28977fc7f1 100644 --- a/embrace-android-sdk/src/main/java/io/embrace/android/embracesdk/session/message/V1PayloadMessageCollator.kt +++ b/embrace-android-sdk/src/main/java/io/embrace/android/embracesdk/session/message/V1PayloadMessageCollator.kt @@ -4,7 +4,6 @@ import io.embrace.android.embracesdk.anr.AnrOtelMapper import io.embrace.android.embracesdk.anr.ndk.NativeAnrOtelMapper import io.embrace.android.embracesdk.anr.ndk.NativeThreadSamplerService import io.embrace.android.embracesdk.arch.schema.AppTerminationCause -import io.embrace.android.embracesdk.capture.PerformanceInfoService import io.embrace.android.embracesdk.capture.internal.errors.InternalErrorService import io.embrace.android.embracesdk.capture.startup.StartupService import io.embrace.android.embracesdk.capture.webview.WebViewService @@ -29,7 +28,6 @@ internal class V1PayloadMessageCollator( private val eventService: EventService, private val logMessageService: LogMessageService, private val internalErrorService: InternalErrorService, - private val performanceInfoService: PerformanceInfoService, private val webViewService: WebViewService, private val nativeThreadSamplerService: NativeThreadSamplerService?, private val preferencesService: PreferencesService, @@ -87,7 +85,7 @@ internal class V1PayloadMessageCollator( startupThreshold = startupInfo?.threshold, symbols = captureDataSafely(logger) { nativeThreadSamplerService?.getNativeSymbols() } ) - val envelope = buildWrapperEnvelope(params, endSession, initial.startTime, endTime) + val envelope = buildWrapperEnvelope(params, endSession) return gatingService.gateSessionMessage(envelope) } @@ -98,9 +96,7 @@ internal class V1PayloadMessageCollator( params: FinalEnvelopeParams.BackgroundActivityParams ): SessionMessage { val msg = buildFinalBackgroundActivity(params) - val startTime = msg.startTime - val endTime = params.endTime - val envelope = buildWrapperEnvelope(params, msg, startTime, endTime) + val envelope = buildWrapperEnvelope(params, msg) return gatingService.gateSessionMessage(envelope) } @@ -142,9 +138,7 @@ internal class V1PayloadMessageCollator( private fun buildWrapperEnvelope( params: FinalEnvelopeParams, - finalPayload: Session, - startTime: Long, - endTime: Long, + finalPayload: Session ): SessionMessage { val spans: List? = captureDataSafely(logger) { webViewService.loadDataIntoSession() @@ -175,14 +169,6 @@ internal class V1PayloadMessageCollator( return SessionMessage( session = finalPayload, - performanceInfo = captureDataSafely(logger) { - performanceInfoService.getSessionPerformanceInfo( - startTime, - endTime, - finalPayload.isColdStart, - null - ) - }, spans = spans, spanSnapshots = spanSnapshots, ) diff --git a/embrace-android-sdk/src/main/java/io/embrace/android/embracesdk/session/message/V2PayloadMessageCollator.kt b/embrace-android-sdk/src/main/java/io/embrace/android/embracesdk/session/message/V2PayloadMessageCollator.kt index f6ee1e813b..115d4fd651 100644 --- a/embrace-android-sdk/src/main/java/io/embrace/android/embracesdk/session/message/V2PayloadMessageCollator.kt +++ b/embrace-android-sdk/src/main/java/io/embrace/android/embracesdk/session/message/V2PayloadMessageCollator.kt @@ -4,7 +4,6 @@ import io.embrace.android.embracesdk.anr.AnrOtelMapper import io.embrace.android.embracesdk.anr.ndk.NativeAnrOtelMapper import io.embrace.android.embracesdk.anr.ndk.NativeThreadSamplerService import io.embrace.android.embracesdk.arch.schema.AppTerminationCause -import io.embrace.android.embracesdk.capture.PerformanceInfoService import io.embrace.android.embracesdk.capture.envelope.session.SessionEnvelopeSource import io.embrace.android.embracesdk.capture.startup.StartupService import io.embrace.android.embracesdk.event.EventService @@ -33,7 +32,6 @@ internal class V2PayloadMessageCollator( private val sessionEnvelopeSource: SessionEnvelopeSource, private val eventService: EventService, private val logMessageService: LogMessageService, - private val performanceInfoService: PerformanceInfoService, private val nativeThreadSamplerService: NativeThreadSamplerService?, private val preferencesService: PreferencesService, private val spanRepository: SpanRepository, @@ -92,7 +90,7 @@ internal class V2PayloadMessageCollator( startupThreshold = startupInfo?.threshold, symbols = captureDataSafely(logger) { nativeThreadSamplerService?.getNativeSymbols() } ) - val envelope = buildWrapperEnvelope(newParams, endSession, initial.startTime, endTime) + val envelope = buildWrapperEnvelope(newParams, endSession) gatingService.gateSessionMessage(envelope) } return obj.convertToV2Payload(newParams.endType) @@ -109,9 +107,7 @@ internal class V2PayloadMessageCollator( logger = logger ) val msg = buildFinalBackgroundActivity(newParams) - val startTime = msg.startTime - val endTime = newParams.endTime - val envelope = buildWrapperEnvelope(newParams, msg, startTime, endTime) + val envelope = buildWrapperEnvelope(newParams, msg) val obj = gatingService.gateSessionMessage(envelope) return obj.convertToV2Payload(newParams.endType) } @@ -151,8 +147,6 @@ internal class V2PayloadMessageCollator( private fun buildWrapperEnvelope( params: FinalEnvelopeParams, finalPayload: Session, - startTime: Long, - endTime: Long, ): SessionMessage { val spans: List? = captureDataSafely(logger) { val result = when { @@ -182,14 +176,6 @@ internal class V2PayloadMessageCollator( return SessionMessage( session = finalPayload, - performanceInfo = captureDataSafely(logger) { - performanceInfoService.getSessionPerformanceInfo( - startTime, - endTime, - finalPayload.isColdStart, - null - ) - }, spans = spans, spanSnapshots = spanSnapshots, ) diff --git a/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/EmbraceGatingServiceV1PayloadTest.kt b/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/EmbraceGatingServiceV1PayloadTest.kt index a7be658672..5436e8bc70 100644 --- a/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/EmbraceGatingServiceV1PayloadTest.kt +++ b/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/EmbraceGatingServiceV1PayloadTest.kt @@ -33,11 +33,11 @@ import io.embrace.android.embracesdk.gating.SessionGatingKeys.SESSION_USER_TERMI import io.embrace.android.embracesdk.gating.SessionGatingKeys.STARTUP_MOMENT import io.embrace.android.embracesdk.gating.SessionGatingKeys.USER_PERSONAS import io.embrace.android.embracesdk.internal.payload.EnvelopeMetadata +import io.embrace.android.embracesdk.internal.payload.EnvelopeResource import io.embrace.android.embracesdk.internal.serialization.EmbraceSerializer import io.embrace.android.embracesdk.internal.utils.Uuid import io.embrace.android.embracesdk.logging.EmbLogger import io.embrace.android.embracesdk.logging.EmbLoggerImpl -import io.embrace.android.embracesdk.payload.DiskUsage import io.embrace.android.embracesdk.payload.Event import io.embrace.android.embracesdk.payload.EventMessage import io.embrace.android.embracesdk.payload.Orientation @@ -362,8 +362,7 @@ internal class EmbraceGatingServiceV1PayloadTest { session = fakeSession(), metadata = EnvelopeMetadata( personas = setOf("persona") - ), - performanceInfo = PerformanceInfo(), + ) ) cfg = buildCustomRemoteConfig(setOf(USER_PERSONAS), null) @@ -374,17 +373,10 @@ internal class EmbraceGatingServiceV1PayloadTest { @Test fun `test gate performance info for Session`() { - val performanceInfo = PerformanceInfo( - diskUsage = DiskUsage(100, null) - ) - - val sessionPerformanceInfo = performanceInfo.copy() - val sessionMessage = SessionMessage( session = fakeSession(), - performanceInfo = sessionPerformanceInfo + resource = EnvelopeResource(diskTotalCapacity = 100) ) - cfg = buildCustomRemoteConfig( setOf( PERFORMANCE_ANR, @@ -398,8 +390,8 @@ internal class EmbraceGatingServiceV1PayloadTest { val sanitizedMessage = gatingService.gateSessionMessage(sessionMessage) - val perfInfo = checkNotNull(sanitizedMessage.performanceInfo) - assertNotNull(perfInfo.diskUsage) + val perfInfo = checkNotNull(sanitizedMessage.resource) + assertNotNull(perfInfo.diskTotalCapacity) } @Test diff --git a/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/FakeBackgroundActivity.kt b/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/FakeBackgroundActivity.kt index fe55c1c27e..f2b82560fe 100644 --- a/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/FakeBackgroundActivity.kt +++ b/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/FakeBackgroundActivity.kt @@ -3,8 +3,6 @@ package io.embrace.android.embracesdk import io.embrace.android.embracesdk.internal.payload.EnvelopeMetadata import io.embrace.android.embracesdk.internal.payload.EnvelopeResource import io.embrace.android.embracesdk.internal.spans.EmbraceSpanData -import io.embrace.android.embracesdk.payload.DiskUsage -import io.embrace.android.embracesdk.payload.PerformanceInfo import io.embrace.android.embracesdk.payload.Session import io.embrace.android.embracesdk.payload.SessionMessage import io.opentelemetry.api.trace.StatusCode @@ -12,11 +10,9 @@ import io.opentelemetry.api.trace.StatusCode internal fun fakeBackgroundActivityMessage(): SessionMessage { val backgroundActivity = fakeBackgroundActivity() val spans = listOf(EmbraceSpanData("fake-span-id", "", "", "", 0, 0, StatusCode.OK)) - val perfInfo = PerformanceInfo(DiskUsage(1, 2)) return SessionMessage( backgroundActivity, - perfInfo, spans, metadata = EnvelopeMetadata( userId = "fake-user-id", diff --git a/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/SessionSanitizerFacadeTest.kt b/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/SessionSanitizerFacadeTest.kt index 4f599253d1..b775123644 100644 --- a/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/SessionSanitizerFacadeTest.kt +++ b/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/SessionSanitizerFacadeTest.kt @@ -1,10 +1,10 @@ package io.embrace.android.embracesdk -import io.embrace.android.embracesdk.fakes.fakePerformanceInfo import io.embrace.android.embracesdk.fakes.fakeSession import io.embrace.android.embracesdk.gating.SessionGatingKeys import io.embrace.android.embracesdk.gating.SessionSanitizerFacade import io.embrace.android.embracesdk.internal.payload.EnvelopeMetadata +import io.embrace.android.embracesdk.internal.payload.EnvelopeResource import io.embrace.android.embracesdk.payload.Orientation import io.embrace.android.embracesdk.payload.SessionMessage import org.junit.Assert.assertNotNull @@ -13,8 +13,6 @@ import org.junit.Test internal class SessionSanitizerFacadeTest { - private val sessionPerformanceInfo = fakePerformanceInfo() - private val session = fakeSession().copy( properties = mapOf("example" to "example"), orientations = listOf(Orientation(0, 0L)), @@ -31,10 +29,12 @@ internal class SessionSanitizerFacadeTest { private val sessionMessage = SessionMessage( session = session, - performanceInfo = sessionPerformanceInfo, metadata = EnvelopeMetadata( email = "example@embrace.com", personas = setOf("personas") + ), + resource = EnvelopeResource( + diskTotalCapacity = 100 ) ) @@ -77,8 +77,7 @@ internal class SessionSanitizerFacadeTest { assertNotNull(sanitizedMessage.session.eventIds) assertNotNull(sanitizedMessage.session.startupDuration) assertNotNull(sanitizedMessage.session.startupThreshold) - - assertNotNull(sanitizedMessage.performanceInfo?.diskUsage) + assertNotNull(sanitizedMessage.resource?.diskTotalCapacity) } @Test @@ -100,7 +99,6 @@ internal class SessionSanitizerFacadeTest { assertNull(sanitizedMessage.session.eventIds) assertNull(sanitizedMessage.session.startupDuration) assertNull(sanitizedMessage.session.startupThreshold) - - assertNull(sanitizedMessage.performanceInfo?.diskUsage) + assertNull(sanitizedMessage.resource?.diskTotalCapacity) } } diff --git a/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/payload/BackgroundActivityMessageTest.kt b/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/payload/BackgroundActivityMessageTest.kt index fabcfbaecc..7ec08b1398 100644 --- a/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/payload/BackgroundActivityMessageTest.kt +++ b/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/payload/BackgroundActivityMessageTest.kt @@ -15,13 +15,7 @@ internal class BackgroundActivityMessageTest { private val backgroundActivity = fakeBackgroundActivity() private val spans = listOf(EmbraceSpanData("fake-span-id", "", "", "", 0, 0, StatusCode.OK)) - private val perfInfo = PerformanceInfo(DiskUsage(1, 2)) - - private val info = SessionMessage( - backgroundActivity, - perfInfo, - spans - ) + private val info = SessionMessage(backgroundActivity, spans) @Test fun testSerialization() { @@ -32,9 +26,7 @@ internal class BackgroundActivityMessageTest { fun testDeserialization() { val obj = deserializeJsonFromResource("bg_activity_message_expected.json") assertNotNull(obj) - assertEquals(backgroundActivity.startTime, obj.session.startTime) - assertEquals(perfInfo, obj.performanceInfo) assertEquals(spans, obj.spans) } diff --git a/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/payload/SessionMessageTest.kt b/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/payload/SessionMessageTest.kt index bf5764d941..a99e10ce11 100644 --- a/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/payload/SessionMessageTest.kt +++ b/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/payload/SessionMessageTest.kt @@ -19,7 +19,6 @@ import org.junit.Test internal class SessionMessageTest { private val session = fakeSession() - private val performanceInfo = PerformanceInfo(DiskUsage(150923409L, 509209823L)) private val spans = listOf( EmbraceSpanData( "fake-span-id", @@ -37,7 +36,6 @@ internal class SessionMessageTest { private val info = SessionMessage( session, - performanceInfo, spans, spanSnapshots ) @@ -52,7 +50,6 @@ internal class SessionMessageTest { val obj = deserializeJsonFromResource("session_message_expected.json") assertNotNull(obj) assertEquals(session, obj.session) - assertEquals(performanceInfo, obj.performanceInfo) assertEquals(spans, obj.spans) assertEquals(spanSnapshots, obj.spanSnapshots) } diff --git a/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/session/PayloadFactoryBaTest.kt b/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/session/PayloadFactoryBaTest.kt index d1e63791ff..eca81bd110 100644 --- a/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/session/PayloadFactoryBaTest.kt +++ b/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/session/PayloadFactoryBaTest.kt @@ -25,7 +25,6 @@ import io.embrace.android.embracesdk.fakes.FakeGatingService import io.embrace.android.embracesdk.fakes.FakeInternalErrorService import io.embrace.android.embracesdk.fakes.FakeLogMessageService import io.embrace.android.embracesdk.fakes.FakeMetadataService -import io.embrace.android.embracesdk.fakes.FakePerformanceInfoService import io.embrace.android.embracesdk.fakes.FakePreferenceService import io.embrace.android.embracesdk.fakes.FakeProcessStateService import io.embrace.android.embracesdk.fakes.FakeSessionIdTracker @@ -54,7 +53,6 @@ internal class PayloadFactoryBaTest { private val initial = fakeBackgroundActivity() private lateinit var service: PayloadFactoryImpl private lateinit var clock: FakeClock - private lateinit var performanceInfoService: FakePerformanceInfoService private lateinit var metadataService: MetadataService private lateinit var sessionIdTracker: FakeSessionIdTracker private lateinit var activityService: FakeProcessStateService @@ -76,7 +74,6 @@ internal class PayloadFactoryBaTest { @Before fun init() { clock = FakeClock(10000L) - performanceInfoService = FakePerformanceInfoService() metadataService = FakeMetadataService() sessionIdTracker = FakeSessionIdTracker() activityService = FakeProcessStateService(isInBackground = true) @@ -162,7 +159,6 @@ internal class PayloadFactoryBaTest { eventService, logMessageService, internalErrorService, - performanceInfoService, FakeWebViewService(), null, preferencesService, @@ -185,7 +181,6 @@ internal class PayloadFactoryBaTest { sessionEnvelopeSource, eventService, logMessageService, - performanceInfoService, null, preferencesService, spanRepository, diff --git a/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/session/PayloadFactorySessionTest.kt b/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/session/PayloadFactorySessionTest.kt index c3a1d57fe1..791a0c9d10 100644 --- a/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/session/PayloadFactorySessionTest.kt +++ b/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/session/PayloadFactorySessionTest.kt @@ -24,7 +24,6 @@ import io.embrace.android.embracesdk.fakes.FakeGatingService import io.embrace.android.embracesdk.fakes.FakeInternalErrorService import io.embrace.android.embracesdk.fakes.FakeLogMessageService import io.embrace.android.embracesdk.fakes.FakeMetadataService -import io.embrace.android.embracesdk.fakes.FakePerformanceInfoService import io.embrace.android.embracesdk.fakes.FakePreferenceService import io.embrace.android.embracesdk.fakes.FakeProcessStateService import io.embrace.android.embracesdk.fakes.FakeSessionIdTracker @@ -63,7 +62,6 @@ internal class PayloadFactorySessionTest { private lateinit var deliveryService: FakeDeliveryService private lateinit var configService: FakeConfigService private lateinit var clock: FakeClock - private lateinit var performanceInfoService: FakePerformanceInfoService private lateinit var metadataService: MetadataService private lateinit var sessionIdTracker: FakeSessionIdTracker private lateinit var activityService: FakeProcessStateService @@ -104,7 +102,6 @@ internal class PayloadFactorySessionTest { clock = FakeClock(10000L) spanSink = FakeInitModule(clock = clock).openTelemetryModule.spanSink - performanceInfoService = FakePerformanceInfoService() metadataService = FakeMetadataService() sessionIdTracker = FakeSessionIdTracker() activityService = FakeProcessStateService(isInBackground = true) @@ -174,7 +171,6 @@ internal class PayloadFactorySessionTest { sessionEnvelopeSource, eventService, logMessageService, - performanceInfoService, null, preferencesService, spanRepository, diff --git a/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/session/SessionHandlerTest.kt b/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/session/SessionHandlerTest.kt index 397882f2bd..ff8e556d56 100644 --- a/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/session/SessionHandlerTest.kt +++ b/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/session/SessionHandlerTest.kt @@ -5,7 +5,6 @@ import io.embrace.android.embracesdk.FakeNdkService import io.embrace.android.embracesdk.FakeSessionPropertiesService import io.embrace.android.embracesdk.anr.AnrOtelMapper import io.embrace.android.embracesdk.anr.ndk.NativeAnrOtelMapper -import io.embrace.android.embracesdk.capture.PerformanceInfoService import io.embrace.android.embracesdk.capture.envelope.session.SessionEnvelopeSourceImpl import io.embrace.android.embracesdk.capture.internal.errors.EmbraceInternalErrorService import io.embrace.android.embracesdk.capture.webview.WebViewService @@ -26,7 +25,6 @@ import io.embrace.android.embracesdk.fakes.FakeGatingService import io.embrace.android.embracesdk.fakes.FakeLogMessageService import io.embrace.android.embracesdk.fakes.FakeMemoryCleanerService import io.embrace.android.embracesdk.fakes.FakeMetadataService -import io.embrace.android.embracesdk.fakes.FakePerformanceInfoService import io.embrace.android.embracesdk.fakes.FakePreferenceService import io.embrace.android.embracesdk.fakes.FakeSessionIdTracker import io.embrace.android.embracesdk.fakes.FakeSessionPayloadSource @@ -82,7 +80,6 @@ internal class SessionHandlerTest { private val initial = fakeSession(startMs = NOW) private val userService: FakeUserService = FakeUserService() - private val performanceInfoService: PerformanceInfoService = FakePerformanceInfoService() private val webViewService: WebViewService = FakeWebViewService() private var activeSession: Session = fakeSession() @@ -153,7 +150,6 @@ internal class SessionHandlerTest { eventService, logMessageService, internalErrorService, - performanceInfoService, webViewService, null, preferencesService, @@ -175,7 +171,6 @@ internal class SessionHandlerTest { ), eventService, logMessageService, - performanceInfoService, null, preferencesService, spanRepository, diff --git a/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/session/V1PayloadMessageCollatorTest.kt b/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/session/V1PayloadMessageCollatorTest.kt index cababf8f26..ead0615ee1 100644 --- a/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/session/V1PayloadMessageCollatorTest.kt +++ b/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/session/V1PayloadMessageCollatorTest.kt @@ -8,7 +8,6 @@ import io.embrace.android.embracesdk.fakes.FakeEventService import io.embrace.android.embracesdk.fakes.FakeGatingService import io.embrace.android.embracesdk.fakes.FakeInternalErrorService import io.embrace.android.embracesdk.fakes.FakeLogMessageService -import io.embrace.android.embracesdk.fakes.FakePerformanceInfoService import io.embrace.android.embracesdk.fakes.FakePreferenceService import io.embrace.android.embracesdk.fakes.FakeStartupService import io.embrace.android.embracesdk.fakes.FakeWebViewService @@ -65,7 +64,6 @@ internal class V1PayloadMessageCollatorTest { internalErrorService = FakeInternalErrorService().apply { data = LegacyExceptionError() }, - performanceInfoService = FakePerformanceInfoService(), spanRepository = initModule.openTelemetryModule.spanRepository, spanSink = initModule.openTelemetryModule.spanSink, currentSessionSpan = initModule.openTelemetryModule.currentSessionSpan, @@ -201,7 +199,6 @@ internal class V1PayloadMessageCollatorTest { private fun SessionMessage.verifyFinalFieldsPopulated( payloadType: PayloadType ) { - assertNotNull(performanceInfo) session.verifyInitialFieldsPopulated(payloadType) session.verifyFinalFieldsPopulated(payloadType) } diff --git a/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/session/message/PayloadFactoryImplTest.kt b/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/session/message/PayloadFactoryImplTest.kt index ab5e667dbd..ffa9598791 100644 --- a/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/session/message/PayloadFactoryImplTest.kt +++ b/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/session/message/PayloadFactoryImplTest.kt @@ -14,7 +14,6 @@ import io.embrace.android.embracesdk.fakes.FakeEventService import io.embrace.android.embracesdk.fakes.FakeGatingService import io.embrace.android.embracesdk.fakes.FakeInternalErrorService import io.embrace.android.embracesdk.fakes.FakeLogMessageService -import io.embrace.android.embracesdk.fakes.FakePerformanceInfoService import io.embrace.android.embracesdk.fakes.FakePreferenceService import io.embrace.android.embracesdk.fakes.FakeSessionPayloadSource import io.embrace.android.embracesdk.fakes.FakeStartupService @@ -55,7 +54,6 @@ internal class PayloadFactoryImplTest { internalErrorService = FakeInternalErrorService().apply { data = LegacyExceptionError() }, - performanceInfoService = FakePerformanceInfoService(), spanRepository = initModule.openTelemetryModule.spanRepository, spanSink = initModule.openTelemetryModule.spanSink, currentSessionSpan = initModule.openTelemetryModule.currentSessionSpan, @@ -71,7 +69,6 @@ internal class PayloadFactoryImplTest { preferencesService = FakePreferenceService(), eventService = FakeEventService(), logMessageService = FakeLogMessageService(), - performanceInfoService = FakePerformanceInfoService(), spanRepository = initModule.openTelemetryModule.spanRepository, spanSink = initModule.openTelemetryModule.spanSink, currentSessionSpan = initModule.openTelemetryModule.currentSessionSpan, diff --git a/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/session/message/V2PayloadMessageCollatorTest.kt b/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/session/message/V2PayloadMessageCollatorTest.kt index 556e755720..0c1b04ef08 100644 --- a/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/session/message/V2PayloadMessageCollatorTest.kt +++ b/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/session/message/V2PayloadMessageCollatorTest.kt @@ -11,7 +11,6 @@ import io.embrace.android.embracesdk.fakes.FakeEventService import io.embrace.android.embracesdk.fakes.FakeGatingService import io.embrace.android.embracesdk.fakes.FakeInternalErrorService import io.embrace.android.embracesdk.fakes.FakeLogMessageService -import io.embrace.android.embracesdk.fakes.FakePerformanceInfoService import io.embrace.android.embracesdk.fakes.FakePreferenceService import io.embrace.android.embracesdk.fakes.FakeSessionPayloadSource import io.embrace.android.embracesdk.fakes.FakeStartupService @@ -56,7 +55,6 @@ internal class V2PayloadMessageCollatorTest { eventService = FakeEventService(), logMessageService = FakeLogMessageService(), internalErrorService = FakeInternalErrorService().apply { data = LegacyExceptionError() }, - performanceInfoService = FakePerformanceInfoService(), spanRepository = initModule.openTelemetryModule.spanRepository, spanSink = initModule.openTelemetryModule.spanSink, currentSessionSpan = initModule.openTelemetryModule.currentSessionSpan, @@ -77,7 +75,6 @@ internal class V2PayloadMessageCollatorTest { preferencesService = FakePreferenceService(), eventService = FakeEventService(), logMessageService = FakeLogMessageService(), - performanceInfoService = FakePerformanceInfoService(), spanRepository = initModule.openTelemetryModule.spanRepository, spanSink = initModule.openTelemetryModule.spanSink, currentSessionSpan = initModule.openTelemetryModule.currentSessionSpan, @@ -174,7 +171,6 @@ internal class V2PayloadMessageCollatorTest { payloadType: PayloadType ) { assertNull(spans) - assertNotNull(performanceInfo) assertNotNull(resource) assertNotNull(metadata) assertNotNull(data) diff --git a/embrace-android-sdk/src/test/resources/bg_activity_message_expected.json b/embrace-android-sdk/src/test/resources/bg_activity_message_expected.json index 9a3682203c..33bc0d63ae 100644 --- a/embrace-android-sdk/src/test/resources/bg_activity_message_expected.json +++ b/embrace-android-sdk/src/test/resources/bg_activity_message_expected.json @@ -8,12 +8,6 @@ "cs": false, "sm": "s" }, - "p": { - "ds": { - "as": 1, - "fs": 2 - } - }, "spans": [ { "trace_id": "fake-span-id", diff --git a/embrace-android-sdk/src/test/resources/session_message_expected.json b/embrace-android-sdk/src/test/resources/session_message_expected.json index cb9cdfa714..c796d30bef 100644 --- a/embrace-android-sdk/src/test/resources/session_message_expected.json +++ b/embrace-android-sdk/src/test/resources/session_message_expected.json @@ -9,12 +9,6 @@ "sm": "s", "sp": {} }, - "p": { - "ds": { - "as": 150923409, - "fs": 509209823 - } - }, "spans": [ { "trace_id": "fake-span-id", diff --git a/embrace-android-sdk/src/test/resources/v1_session_expected.json b/embrace-android-sdk/src/test/resources/v1_session_expected.json index 85e308a8d5..775237ea7e 100644 --- a/embrace-android-sdk/src/test/resources/v1_session_expected.json +++ b/embrace-android-sdk/src/test/resources/v1_session_expected.json @@ -1,11 +1,5 @@ { "d": "__EMBRACE_TEST_IGNORE__", - "p": { - "ds": { - "as": "__EMBRACE_TEST_IGNORE__", - "fs": "__EMBRACE_TEST_IGNORE__" - } - }, "s": { "as": "__EMBRACE_TEST_IGNORE__", "ty": "__EMBRACE_TEST_IGNORE__",