summaryrefslogtreecommitdiff
path: root/src/mongo/db/curop.h
diff options
context:
space:
mode:
authorBernard Gorman <bernard.gorman@gmail.com>2018-03-21 21:08:20 +0000
committerBernard Gorman <bernard.gorman@gmail.com>2018-03-22 03:36:43 +0000
commit40d59f4bc8eec0fc585edec0f2c8833f09a4a853 (patch)
treef5654a7274c4925ad3be8d46e305f8478894c445 /src/mongo/db/curop.h
parentb7178eca18c1a56b05eb206fa9d202345c128df5 (diff)
downloadmongo-40d59f4bc8eec0fc585edec0f2c8833f09a4a853.tar.gz
SERVER-14900 Log operations that exceed slowMs on mongoS
Diffstat (limited to 'src/mongo/db/curop.h')
-rw-r--r--src/mongo/db/curop.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/mongo/db/curop.h b/src/mongo/db/curop.h
index bdb30791060..2cdefe4d859 100644
--- a/src/mongo/db/curop.h
+++ b/src/mongo/db/curop.h
@@ -55,7 +55,7 @@ public:
std::string report(Client* client,
const CurOp& curop,
- const SingleThreadedLockStats& lockStats) const;
+ const SingleThreadedLockStats* lockStats) const;
/**
* Appends information about the current operation to "builder"
@@ -186,6 +186,18 @@ public:
BSONObj cmdObj,
NetworkOp op);
+ /**
+ * Marks the operation end time, records the length of the client response if a valid response
+ * exists, and then - subject to the current values of slowMs and sampleRate - logs this CurOp
+ * to file under the given LogComponent. Returns 'true' if, in addition to being logged, this
+ * operation should also be profiled.
+ */
+ bool completeAndLogOperation(OperationContext* opCtx,
+ logger::LogComponent logComponent,
+ boost::optional<size_t> responseLength = boost::none,
+ boost::optional<long long> slowMsOverride = boost::none,
+ bool forceLog = false);
+
bool haveOpDescription() const {
return !_opDescription.isEmpty();
}