summaryrefslogtreecommitdiff
path: root/src/mongo/db/stats/resource_consumption_metrics.h
diff options
context:
space:
mode:
authordziana.hurynovich <dziana.hurynovich@mongodb.com>2023-01-30 10:24:43 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2023-01-30 11:09:50 +0000
commitb1195b271c5944cd9b68763b91697828f5cda58b (patch)
tree9790a08345e343a016e835f2b86a7cc58a2bab5e /src/mongo/db/stats/resource_consumption_metrics.h
parent0de85d50a1d7a1c3b3f2dd73145b7dd55b37b56a (diff)
downloadmongo-b1195b271c5944cd9b68763b91697828f5cda58b.tar.gz
Revert "SERVER-70032 Report CPU time in slow query logs and profiler as cpuNanos"
This reverts commit 0d5ad158ceb6fea1004034bcb78c82c9daf69eac.
Diffstat (limited to 'src/mongo/db/stats/resource_consumption_metrics.h')
-rw-r--r--src/mongo/db/stats/resource_consumption_metrics.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/mongo/db/stats/resource_consumption_metrics.h b/src/mongo/db/stats/resource_consumption_metrics.h
index 59dffb7d2c3..f41042b29ab 100644
--- a/src/mongo/db/stats/resource_consumption_metrics.h
+++ b/src/mongo/db/stats/resource_consumption_metrics.h
@@ -230,7 +230,7 @@ public:
WriteMetrics writeMetrics;
// Records CPU time consumed by this operation.
- std::unique_ptr<OperationCPUTimer> cpuTimer;
+ OperationCPUTimer* cpuTimer = nullptr;
};
/**
@@ -335,6 +335,11 @@ public:
return _metrics;
}
+ void reset() {
+ invariant(!isInScope());
+ *this = {};
+ }
+
/**
* This should be called once per document read with the number of bytes read for that
* document. This is a no-op when metrics collection is disabled on this operation.