summaryrefslogtreecommitdiff
path: root/src/mongo/db/operation_context.h
diff options
context:
space:
mode:
authorA. Jesse Jiryu Davis <jesse@mongodb.com>2020-06-05 15:13:14 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-06-05 20:04:47 +0000
commit84033d0077d507491a6a80c2e1140bf6fd4055dc (patch)
tree4bb6c0b0b39ba8c402320a49ffa14e26ab44feca /src/mongo/db/operation_context.h
parent274b30c62675eb3f04f22e90f76f7891041d9147 (diff)
downloadmongo-84033d0077d507491a6a80c2e1140bf6fd4055dc.tar.gz
SERVER-48393 Exclude awaitable isMaster from serverStatus latency metrics
Diffstat (limited to 'src/mongo/db/operation_context.h')
-rw-r--r--src/mongo/db/operation_context.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/mongo/db/operation_context.h b/src/mongo/db/operation_context.h
index c5116e805b2..46626d843b7 100644
--- a/src/mongo/db/operation_context.h
+++ b/src/mongo/db/operation_context.h
@@ -267,6 +267,20 @@ public:
return _writesAreReplicated;
}
+ /**
+ * Returns true if operations' durations should be added to serverStatus latency metrics.
+ */
+ bool shouldIncrementLatencyStats() const {
+ return _shouldIncrementLatencyStats;
+ }
+
+ /**
+ * Sets the shouldIncrementLatencyStats flag.
+ */
+ void setShouldIncrementLatencyStats(bool shouldIncrementLatencyStats) {
+ _shouldIncrementLatencyStats = shouldIncrementLatencyStats;
+ }
+
void markKillOnClientDisconnect();
/**
@@ -568,6 +582,7 @@ private:
Timer _elapsedTime;
bool _writesAreReplicated = true;
+ bool _shouldIncrementLatencyStats = true;
bool _shouldParticipateInFlowControl = true;
bool _inMultiDocumentTransaction = false;
bool _isStartingMultiDocumentTransaction = false;