diff options
author | Bernard Gorman <bernard.gorman@gmail.com> | 2018-03-21 21:08:20 +0000 |
---|---|---|
committer | Bernard Gorman <bernard.gorman@gmail.com> | 2018-03-22 03:36:43 +0000 |
commit | 40d59f4bc8eec0fc585edec0f2c8833f09a4a853 (patch) | |
tree | f5654a7274c4925ad3be8d46e305f8478894c445 /src/mongo/db/curop.h | |
parent | b7178eca18c1a56b05eb206fa9d202345c128df5 (diff) | |
download | mongo-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.h | 14 |
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(); } |