From 5511f6f21b4f34ac661857b9a65344bc1a4276cb Mon Sep 17 00:00:00 2001 From: Andres Taylor Date: Thu, 19 Sep 2024 15:07:57 +0200 Subject: [PATCH] list queries in same order as the first trace file Signed-off-by: Andres Taylor --- src/cmd/vtbenchstat/vtbenchstat.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/cmd/vtbenchstat/vtbenchstat.go b/src/cmd/vtbenchstat/vtbenchstat.go index 41913ef..5879d5b 100644 --- a/src/cmd/vtbenchstat/vtbenchstat.go +++ b/src/cmd/vtbenchstat/vtbenchstat.go @@ -236,9 +236,10 @@ func compareTraces(file1, file2 TraceFile) { var s1RouteCalls, s1DataSent, s1MemoryRows, s1ShardsQueried int var s2RouteCalls, s2DataSent, s2MemoryRows, s2ShardsQueried int - for query, s1 := range summary1 { - s2, ok := summary2[query] - if !ok { + for _, q := range file1.Queries { + s1, ok1 := summary1[q.Query] + s2, ok2 := summary2[q.Query] + if !ok1 || !ok2 { continue } totalQueries++