IJPL-797 intellij.platform.diagnostic.telemetry.impl review internal API

GitOrigin-RevId: 750ce6c23be3c7baab4c7138c992c2b01b9c9085
This commit is contained in:
Nikita Kudrin
2024-05-13 17:27:10 +03:00
committed by intellij-monorepo-bot
parent 737f3d1a26
commit a00765ba5e
4 changed files with 4 additions and 8 deletions

View File

@@ -1,11 +1,4 @@
c:com.intellij.platform.diagnostic.telemetry.impl.DefaultTraceReporter
- <init>(Z):V
- end(com.intellij.diagnostic.ActivityImpl,java.lang.String,J,J):V
- setEndAndAdd(com.intellij.diagnostic.ActivityImpl,J):V
- start(java.lang.String,J,com.intellij.diagnostic.ActivityImpl):com.intellij.diagnostic.ActivityImpl
f:com.intellij.platform.diagnostic.telemetry.impl.OtlpServiceKt
- sf:computeSpanId(com.intellij.diagnostic.ActivityImpl):B[]
- sf:computeTraceId(com.intellij.diagnostic.ActivityImpl):B[]
- sf:getOtlpEndPoint():java.lang.String
f:com.intellij.platform.diagnostic.telemetry.impl.TracerKt
- sf:rootTask():kotlin.coroutines.CoroutineContext

View File

@@ -1 +0,0 @@
com/intellij/diagnostic/ActivityImpl

View File

@@ -18,6 +18,7 @@ import kotlinx.coroutines.selects.onTimeout
import kotlinx.coroutines.selects.select
import kotlinx.serialization.encodeToByteArray
import kotlinx.serialization.protobuf.ProtoBuf
import org.jetbrains.annotations.ApiStatus.Internal
import java.net.ConnectException
import java.nio.ByteBuffer
import java.time.ZoneOffset
@@ -179,6 +180,7 @@ internal class OtlpService private constructor() {
}
}
@Internal
fun computeTraceId(span: ActivityImpl): ByteArray {
val otlpService = OtlpService.getInstance()
val traceIdSalt = otlpService.traceIdSalt
@@ -197,6 +199,7 @@ fun computeTraceId(span: ActivityImpl): ByteArray {
return byteBuffer.array()
}
@Internal
fun computeSpanId(span: ActivityImpl): ByteArray {
val byteBuffer = ByteBuffer.allocate(8)
byteBuffer.putInt((span.start / 1_000_000).toInt())

View File

@@ -176,6 +176,7 @@ private class CoroutineTimeMeasurer(private val parentActivity: ActivityImpl?,
fun getActivity() = CURRENT_ACTIVITY.getVolatile(this) as ActivityImpl?
}
@Internal
open class DefaultTraceReporter(private val reportScheduleTimeForRoot: Boolean) : TraceReporter {
override fun start(coroutineName: String, scheduleTime: Long, parentActivity: ActivityImpl?): ActivityImpl {
val start = System.nanoTime()