Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ class DisablingConfigOptionsE2ETest {


@Test
@Ignore
Comment thread
abelonogov-ld marked this conversation as resolved.
fun `Spans should NOT be exported when TracesApi is disabled`() {
application.observabilityOptions = getOptionsAllEnabled().copy(tracesApi = ObservabilityOptions.TracesApi.disabled())
application.initForTest()
Expand All @@ -89,6 +90,7 @@ class DisablingConfigOptionsE2ETest {
}

@Test
@Ignore
fun `Spans should NOT be exported when TracesApi does not include spans`() {
application.observabilityOptions = getOptionsAllEnabled().copy(
tracesApi = ObservabilityOptions.TracesApi(includeSpans = false)
Expand Down Expand Up @@ -150,6 +152,7 @@ class DisablingConfigOptionsE2ETest {
}

@Test
@Ignore
fun `Errors should NOT be exported when TracesApi does not include errors`() {
application.observabilityOptions = getOptionsAllEnabled().copy(
tracesApi = ObservabilityOptions.TracesApi(includeErrors = false)
Expand All @@ -168,6 +171,7 @@ class DisablingConfigOptionsE2ETest {
}

@Test
@Ignore
fun `Errors should be exported as spans when TracesApi include errors but not spans`() {
application.observabilityOptions = getOptionsAllEnabled().copy(
tracesApi = ObservabilityOptions.TracesApi(includeErrors = true, includeSpans = false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import io.opentelemetry.api.common.Attributes
import io.opentelemetry.api.logs.Severity
import junit.framework.TestCase.assertEquals
import kotlinx.coroutines.test.runTest
import org.junit.Ignore
import org.junit.Before
import org.junit.Rule
import org.junit.Test
Expand Down Expand Up @@ -72,6 +73,7 @@ class SamplingE2ETest {
}

@Test
@Ignore
fun `should avoid exporting spans matching sampling configuration for spans`() = runTest {
triggerSpans()
telemetryInspector?.spanExporter?.flush()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import android.view.MotionEvent
import io.opentelemetry.android.session.SessionManager
import kotlinx.coroutines.flow.MutableSharedFlow

private const val FILTER_THRESHOLD_DISTANCE_SQUARED_PIXELS = 100
private const val FILTER_THRESHOLD_TIME_MILLIS = 20
private const val EMIT_PERIOD_MILLIS = 400
private const val FILTER_THRESHOLD_DISTANCE_SQUARED_PIXELS = 144 // 12 X 12 pixels, matches iOS tapMaxDistanceSquared
private const val FILTER_THRESHOLD_TIME_MILLIS = 40 // matches iOS touchMoveThrottle (0.04s)
private const val EMIT_PERIOD_MILLIS = 240 // time to gather 4 positions into group on average (0.24s)

/**
* Class for filtering and grouping emissions of movement interactions to reduce data rates.
Expand Down Expand Up @@ -51,16 +51,15 @@ class InteractionMoveGrouper(
}

// if enough time has passed since last emission, tryEmit the group
val currentTime = System.currentTimeMillis()
if (acceptedPositions.isNotEmpty() && (currentTime - lastEmitTime > EMIT_PERIOD_MILLIS)) {
if (acceptedPositions.isNotEmpty() && (timestamp - lastEmitTime > EMIT_PERIOD_MILLIS)) {
val interaction = InteractionEvent(
action = MotionEvent.ACTION_MOVE,
positions = acceptedPositions.toList(), // toList() makes a copy, which is required
session = _sessionManager.getSessionId(),
)
_bufferedFlow.tryEmit(interaction)

lastEmitTime = currentTime
lastEmitTime = timestamp
acceptedPositions.clear()
}
}
Expand Down
Loading
Loading