From 7ffc10377714931a7b957fdeecd2703f10fa6683 Mon Sep 17 00:00:00 2001 From: Alan Bernstein Date: Mon, 19 Apr 2021 22:22:56 -0500 Subject: [PATCH] Add 'ns' units to query history runtime json --- tracker.go | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/tracker.go b/tracker.go index bec0cf4db..3de1ca857 100644 --- a/tracker.go +++ b/tracker.go @@ -29,12 +29,13 @@ type ActiveQueryStatus struct { } type PastQueryStatus struct { - PQL string `json:"PQL"` - SQL string `json:"SQL,omitempty"` - Node string `json:"nodeID"` - Index string `json:"index"` - Start time.Time `json:"start"` - Runtime time.Duration `json:"runtime"` + PQL string `json:"PQL"` + SQL string `json:"SQL,omitempty"` + Node string `json:"nodeID"` + Index string `json:"index"` + Start time.Time `json:"start"` + Runtime time.Duration `json:"runtime"` // deprecated + RuntimeNs time.Duration `json:"runtimeNanoseconds"` } type activeQuery struct { @@ -190,7 +191,7 @@ func (t *queryTracker) PastQueries() []PastQueryStatus { queries := t.history.slice() out := make([]PastQueryStatus, len(queries)) for i, v := range queries { - out[i] = PastQueryStatus{v.PQL, v.SQL, v.node, v.index, v.started, v.runtime} + out[i] = PastQueryStatus{v.PQL, v.SQL, v.node, v.index, v.started, v.runtime, v.runtime} } return out