diff options
author | Lingzhi Deng <lzddennis@gmail.com> | 2020-01-20 23:26:43 -0500 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-01-28 03:03:27 +0000 |
commit | a24723a0811067755642c86143ac484044ef2812 (patch) | |
tree | b7605637b2760d2875de9b278ed8abc7c603436e /src/mongo/db/curop.cpp | |
parent | aea2622937550adae02f2e374398dca8cd5003dd (diff) | |
download | mongo-a24723a0811067755642c86143ac484044ef2812.tar.gz |
SERVER-44711: Add metrics.repl.network.oplogGetMoresProcessed
Diffstat (limited to 'src/mongo/db/curop.cpp')
-rw-r--r-- | src/mongo/db/curop.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mongo/db/curop.cpp b/src/mongo/db/curop.cpp index a043ef72d0d..de89c4b5789 100644 --- a/src/mongo/db/curop.cpp +++ b/src/mongo/db/curop.cpp @@ -55,6 +55,7 @@ #include "mongo/util/log.h" #include "mongo/util/net/socket_utils.h" #include "mongo/util/str.h" +#include <mongo/db/stats/timer_stats.h> namespace mongo { @@ -76,6 +77,10 @@ const std::vector<const char*> kDollarQueryModifiers = { "$maxTimeMS", }; +TimerStats oplogGetMoreStats; +ServerStatusMetricField<TimerStats> displayBatchesReceived("repl.network.oplogGetMoresProcessed", + &oplogGetMoreStats); + } // namespace BSONObj upconvertQueryEntry(const BSONObj& query, @@ -431,6 +436,10 @@ bool CurOp::completeAndLogOperation(OperationContext* opCtx, _end = curTimeMicros64(); _debug.executionTimeMicros = durationCount<Microseconds>(elapsedTimeExcludingPauses()); + if (_debug.isReplOplogFetching) { + oplogGetMoreStats.recordMillis(_debug.executionTimeMicros / 1000); + } + const bool shouldSample = client->getPrng().nextCanonicalDouble() < serverGlobalParams.sampleRate; |