summaryrefslogtreecommitdiff
path: root/src/mongo/db/stats/top.cpp
diff options
context:
space:
mode:
authorNathan Louie <nathan.louie@10gen.com>2018-08-16 16:18:00 -0400
committerjinichu <jinnybyun@gmail.com>2018-08-16 16:18:00 -0400
commit48c0ef6564b153b70ff307818c016c2cc36b3ab8 (patch)
tree2cbf0bb92ac99d8e341d8a1031eeb847f7cc26a2 /src/mongo/db/stats/top.cpp
parent8376aa91cb065a7c23d5dcec56e0ab54d30dc81d (diff)
downloadmongo-48c0ef6564b153b70ff307818c016c2cc36b3ab8.tar.gz
SERVER-35159 Track transactions latency and add to serverStatus output
(cherry picked from commit e75f7fa2231cbd78d82923393de84d72702f9bcf)
Diffstat (limited to 'src/mongo/db/stats/top.cpp')
-rw-r--r--src/mongo/db/stats/top.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mongo/db/stats/top.cpp b/src/mongo/db/stats/top.cpp
index 45680f7db15..8a21a1b22ee 100644
--- a/src/mongo/db/stats/top.cpp
+++ b/src/mongo/db/stats/top.cpp
@@ -218,6 +218,11 @@ void Top::appendGlobalLatencyStats(bool includeHistograms, BSONObjBuilder* build
_globalHistogramStats.append(includeHistograms, builder);
}
+void Top::incrementGlobalTransactionLatencyStats(uint64_t latency) {
+ stdx::lock_guard<SimpleMutex> guard(_lock);
+ _globalHistogramStats.increment(latency, Command::ReadWriteType::kTransaction);
+}
+
void Top::_incrementHistogram(OperationContext* opCtx,
long long latency,
OperationLatencyHistogram* histogram,