summaryrefslogtreecommitdiff
path: root/src/mongo/db/curop.cpp
diff options
context:
space:
mode:
authornehakhatri5 <neha.khatri@mongodb.com>2018-12-18 13:21:27 +1100
committernehakhatri5 <neha.khatri@mongodb.com>2018-12-28 14:13:44 +1100
commit86b6aca9fa1940e85bba87261d1494ef2c208a4a (patch)
treeca86b1309576d7e9890d6e2436cbf5d299295c29 /src/mongo/db/curop.cpp
parentaa236ed4f3096c85118f00618eec834c82363527 (diff)
downloadmongo-86b6aca9fa1940e85bba87261d1494ef2c208a4a.tar.gz
SERVER-38240 Added storage statistics information into the slowop log messages.
Diffstat (limited to 'src/mongo/db/curop.cpp')
-rw-r--r--src/mongo/db/curop.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mongo/db/curop.cpp b/src/mongo/db/curop.cpp
index 8ad2499e9b7..e76a248547f 100644
--- a/src/mongo/db/curop.cpp
+++ b/src/mongo/db/curop.cpp
@@ -406,6 +406,7 @@ bool CurOp::completeAndLogOperation(OperationContext* opCtx,
if (shouldLogOp || (shouldSample && _debug.executionTimeMicros > slowMs * 1000LL)) {
auto lockerInfo = opCtx->lockState()->getLockerInfo(_lockStatsBase);
+ _debug.storageStats = opCtx->recoveryUnit()->getOperationStatistics();
log(component) << _debug.report(client, *this, (lockerInfo ? &lockerInfo->stats : nullptr));
}
@@ -673,6 +674,10 @@ string OpDebug::report(Client* client,
s << " locks:" << locks.obj().toString();
}
+ if (storageStats) {
+ s << " storage:" << storageStats->toBSON().toString();
+ }
+
if (iscommand) {
s << " protocol:" << getProtoString(networkOp);
}
@@ -747,6 +752,10 @@ void OpDebug::append(const CurOp& curop,
lockStats.report(&locks);
}
+ if (storageStats) {
+ b.append("storage", storageStats->toBSON());
+ }
+
if (!errInfo.isOK()) {
b.appendNumber("ok", 0.0);
if (!errInfo.reason().empty()) {