-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7b31982
commit a1ef581
Showing
10 changed files
with
131 additions
and
56 deletions.
There are no files selected for viewing
This file contains 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 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 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 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
46 changes: 46 additions & 0 deletions
46
...roid-sdk/src/main/java/io/embrace/android/embracesdk/capture/crumbs/RnActionDataSource.kt
This file contains 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,46 @@ | ||
package io.embrace.android.embracesdk.capture.crumbs | ||
|
||
import io.embrace.android.embracesdk.arch.datasource.SpanDataSourceImpl | ||
import io.embrace.android.embracesdk.arch.limits.UpToLimitStrategy | ||
import io.embrace.android.embracesdk.arch.schema.SchemaType | ||
import io.embrace.android.embracesdk.config.behavior.BreadcrumbBehavior | ||
import io.embrace.android.embracesdk.internal.spans.SpanService | ||
import io.embrace.android.embracesdk.logging.EmbLogger | ||
|
||
internal open class RnActionDataSource( | ||
breadcrumbBehavior: BreadcrumbBehavior, | ||
spanService: SpanService, | ||
logger: EmbLogger | ||
) : SpanDataSourceImpl( | ||
spanService, | ||
logger, | ||
UpToLimitStrategy(logger) { breadcrumbBehavior.getCustomBreadcrumbLimit() } | ||
) { | ||
open fun logRnAction( | ||
name: String?, | ||
startTime: Long, | ||
endTime: Long, | ||
properties: Map<String?, Any?>, | ||
bytesSent: Int, | ||
output: String? | ||
): Boolean = captureSpanData( | ||
countsTowardsLimits = true, | ||
inputValidation = { !name.isNullOrEmpty() }, | ||
captureAction = { | ||
val schemaType = SchemaType.ReactNativeAction( | ||
checkNotNull(name), | ||
checkNotNull(output), | ||
bytesSent, | ||
properties | ||
) | ||
recordCompletedSpan( | ||
name = schemaType.fixedObjectName, | ||
startTimeMs = startTime, | ||
endTimeMs = endTime, | ||
type = schemaType.telemetryType, | ||
private = false, | ||
attributes = schemaType.attributes() | ||
) | ||
} | ||
) | ||
} |
This file contains 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 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 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 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 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