wu-sheng commented on a change in pull request #3906: Support ordered segment
list in trace query
URL: https://github.com/apache/skywalking/pull/3906#discussion_r348469656
##########
File path:
oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/query/TraceQueryService.java
##########
@@ -374,6 +390,14 @@ public Trace queryTrace(final String traceId) throws
IOException {
rootSpans.add(span);
}
});
+ /**
+ * In some cases, there are segment fragments, which could not be
linked by Ref,
+ * because of two kinds of reasons.
+ * 1. Multiple leaf segments have no particular order in the storage.
+ * 2. Lost in sampling, agent fail safe, segment lost, even bug.
+ * Sorting the segments makes the trace view more readable.
+ */
+ rootSpans.sort(Comparator.comparing(span -> new
Long(span.getStartTime())));
Review comment:
Fixed.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services