From 26b757539978b15746c1a06e9a6e6860339b7c76 Mon Sep 17 00:00:00 2001 From: Jason Bulicek Date: Mon, 4 Nov 2019 10:54:11 -0800 Subject: [PATCH] sort timeline results by timestamp to fix graph bug --- server/connectors/traces/haystack/tracesConnector.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/connectors/traces/haystack/tracesConnector.js b/server/connectors/traces/haystack/tracesConnector.js index eb30317b..f2f9e4db 100644 --- a/server/connectors/traces/haystack/tracesConnector.js +++ b/server/connectors/traces/haystack/tracesConnector.js @@ -215,7 +215,8 @@ connector.getLatencyCost = (traceId) => { connector.getTimeline = (query) => traceCountsFetcher.fetch(traceCountsRequestBuilder.buildRequest(query)).then((result) => { const pbTraceCounts = messages.TraceCounts.toObject(false, result); - return pbTraceCountsConverter.toTraceCountsJson(pbTraceCounts); + return pbTraceCountsConverter.toTraceCountsJson(pbTraceCounts) + .sort((a, b) => (a.x - b.x)); }); module.exports = connector;