Skip to content

Commit

Permalink
fix trace span offset (erda-project#805) (erda-project#806)
Browse files Browse the repository at this point in the history
* fix(msp): fix trace span offset

feat(msp): overview

* fix(msp): fix trace span offset

feat(msp): overview

Co-authored-by: Zero <mobius_pan@yeah.net>
  • Loading branch information
erda-bot and Zero-Rock authored Jul 31, 2021
1 parent 98721d7 commit 1fcb917
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -142,13 +142,16 @@ const traceConvert = (traces: MONITOR_TRACE.ITrace): Trace => {
const duration = durationNs / 1000;
const spanDepths = toSpanDepths(oldSpans);
const groupByParentId = groupBy(oldSpans, (s) => s.parentSpanId);
const traceTimestamp = oldSpans[0].timestamp || 0;
let traceTimestamp = 0;

const spans = flatMap(getRootSpans(oldSpans), (rootSpan) =>
childrenToList(createSpanTreeEntry(rootSpan, oldSpans)),
).map((span) => {
).map((span, index) => {
if (!index) {
traceTimestamp = span.startTime;
}
const spanDuration = span.duration / 1000;
const spanStartTs = span.timestamp || traceTimestamp;
const spanStartTs = span.startTime || traceTimestamp;
const spanDepth = spanDepths[span.id] || 1;
const width = ((spanDuration || 0) / duration) * 100;
let errorType = 'none';
Expand Down

0 comments on commit 1fcb917

Please sign in to comment.