Skip to content

Commit 2f2d0b9

Browse files
committed
Refactor the changes
Signed-off-by: Maksim Gaponov <[email protected]>
1 parent 6f7cf46 commit 2f2d0b9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ function getChildOfDrange(parentID: string, allSpans: Span[]) {
4747
const childrenDrange = new DRange();
4848
getChildOfSpans(parentID, allSpans).forEach(s => {
4949
// -1 otherwise it will take for each child a micro (incluse,exclusive)
50-
childrenDrange.add(s.startTime, s.startTime + (s.duration <= 0 ? 0 : s.duration - 1));
50+
childrenDrange.add(10 * s.startTime, 10 * (s.startTime + Math.max(s.duration, 0)) - 1);
5151
});
5252
return childrenDrange;
5353
}
@@ -63,10 +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(span.startTime, span.startTime + span.duration - 1).subtract(
66+
const spanRange = new DRange(10 * span.startTime, 10 * (span.startTime + span.duration) - 1).subtract(
6767
getChildOfDrange(span.spanID, allSpans)
6868
);
69-
return spanRange.length;
69+
return Math.round(spanRange.length / 10);
7070
}
7171

7272
function computeColumnValues(trace: Trace, span: Span, allSpans: Span[], resultValue: any) {

0 commit comments

Comments
 (0)