Refactoring: move FUS collectors checks from CheckFusEventsBaseTest to make them reusable

GitOrigin-RevId: b30f55005e8b1d7047f4b370fb48d3c5ba6fc839
This commit is contained in:
Elena Shaverdova
2024-05-17 18:02:14 +02:00
committed by intellij-monorepo-bot
parent 686ad64d53
commit 162e36c8b8

View File

@@ -188,3 +188,7 @@ private fun getAttributes(spanName: String, metric: MetricWithAttributes): Colle
Metric.newCounter("$spanName#" + attributeMetric.id.name, attributeMetric.value)
}
}
fun getOrderedSpans(openTelemetryFile: Path, spanName: String): List<SpanElement> =
OpentelemetrySpanJsonParser(SpanFilter.nameEquals(spanName)).getSpanElements(openTelemetryFile)
.filter { it.name == spanName }.toList().sortedBy { it.startTimestamp }