Skip to content

Commit 5b97214

Browse files
committed
tweak
1 parent b897763 commit 5b97214

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

common4j/src/main/com/microsoft/identity/common/java/opentelemetry/DefaultBenchmarkSpanPrinter.kt

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -304,17 +304,12 @@ class DefaultBenchmarkSpanPrinter(
304304

305305
val result = mutableListOf<StatisticalStatusData>()
306306

307-
// Precompute the number of occurrences for each status name
308-
val occurrenceCountsByName = statusOccurrencesMap.keys
309-
.groupBy { it.statusName }
310-
.mapValues { it.value.size }
311-
312307
for ((occurrence, timingPairs) in statusOccurrencesMap) {
313308
val timeSincePreviousValues = timingPairs.map { it.first }
314309
val timeSinceStartValues = timingPairs.map { it.second }
315310

316311
// Create display name with occurrence number if there are multiple occurrences
317-
val displayName = if ((occurrenceCountsByName[occurrence.statusName] ?: 1) > 1) {
312+
val displayName = if (occurrence.occurrenceIndex > 1) {
318313
"${occurrence.statusName} [${occurrence.occurrenceIndex}]"
319314
} else {
320315
occurrence.statusName

0 commit comments

Comments
 (0)