summaryrefslogtreecommitdiff
path: root/src/mongo/db/stats/top.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/stats/top.cpp')
-rw-r--r--src/mongo/db/stats/top.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/mongo/db/stats/top.cpp b/src/mongo/db/stats/top.cpp
index e445515cf4b..1674fe394d6 100644
--- a/src/mongo/db/stats/top.cpp
+++ b/src/mongo/db/stats/top.cpp
@@ -200,6 +200,9 @@ void Top::appendLatencyStats(const NamespaceString& nss,
void Top::incrementGlobalLatencyStats(OperationContext* opCtx,
uint64_t latency,
Command::ReadWriteType readWriteType) {
+ if (!opCtx->shouldIncrementLatencyStats())
+ return;
+
stdx::lock_guard<SimpleMutex> guard(_lock);
_incrementHistogram(opCtx, latency, &_globalHistogramStats, readWriteType);
}