summaryrefslogtreecommitdiff
path: root/src/mongo/db/curop.cpp
diff options
context:
space:
mode:
authorLingzhi Deng <lzddennis@gmail.com>2020-01-20 23:26:43 -0500
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-01-28 03:03:27 +0000
commita24723a0811067755642c86143ac484044ef2812 (patch)
treeb7605637b2760d2875de9b278ed8abc7c603436e /src/mongo/db/curop.cpp
parentaea2622937550adae02f2e374398dca8cd5003dd (diff)
downloadmongo-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.cpp9
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;