Skip to content

Commit 8d3593d

Browse files
Refactor the changes
Co-authored-by: Yuri Shkuro <[email protected]> Signed-off-by: Maksim <[email protected]>
1 parent 2f2d0b9 commit 8d3593d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/jaeger-ui/src/components/TracePage/TraceStatistics/tableValues.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,10 @@ function computeSelfTime(span: Span, allSpans: Span[]): number {
6363
// To work around that, we multiply start/end times by 10 and subtract one from the end.
6464
// So instead of [1-10] we get [10-99]. This makes the intervals work like half-open.
6565
if (!span.hasChildren) return span.duration;
66-
const spanRange = new DRange(10 * span.startTime, 10 * (span.startTime + span.duration) - 1).subtract(
67-
getChildOfDrange(span.spanID, allSpans)
66+
const spanRange = new DRange(10 * span.startTime, 10 * (span.startTime + span.duration) - 1);
67+
const children = getChildOfSpans(span.spanID, allSpans);
68+
children.forEach(child => {
69+
spanRange.subtract(10 * child.startTime, 10 * (child.startTime + child.duration) - 1);
6870
);
6971
return Math.round(spanRange.length / 10);
7072
}

0 commit comments

Comments
 (0)