From e7d2be0dae29265e2a6efafd4753debf11b9e96f Mon Sep 17 00:00:00 2001 From: Ruoxin Xu Date: Tue, 26 Jul 2022 10:19:14 +0000 Subject: SERVER-67101 Support microsecond precision in ScopedTimer --- src/mongo/db/pipeline/pipeline.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/mongo/db/pipeline/pipeline.cpp') diff --git a/src/mongo/db/pipeline/pipeline.cpp b/src/mongo/db/pipeline/pipeline.cpp index af52bd79435..73da96013dc 100644 --- a/src/mongo/db/pipeline/pipeline.cpp +++ b/src/mongo/db/pipeline/pipeline.cpp @@ -64,9 +64,10 @@ Value appendCommonExecStats(Value docSource, const CommonStats& stats) { invariant(docSource.getType() == BSONType::Object); MutableDocument doc(docSource.getDocument()); auto nReturned = static_cast(stats.advanced); - invariant(stats.executionTimeMillis); - auto executionTimeMillisEstimate = static_cast(*stats.executionTimeMillis); doc.addField("nReturned", Value(nReturned)); + + invariant(stats.executionTime); + auto executionTimeMillisEstimate = durationCount(*stats.executionTime); doc.addField("executionTimeMillisEstimate", Value(executionTimeMillisEstimate)); return Value(doc.freeze()); } -- cgit v1.2.1