diff options
author | Scott Hernandez <scotthernandez@gmail.com> | 2013-01-29 14:36:24 -0500 |
---|---|---|
committer | Scott Hernandez <scotthernandez@gmail.com> | 2013-01-29 14:36:24 -0500 |
commit | 84df92e10e2458cd4ff3751c620535aa9f9a92b6 (patch) | |
tree | 19dbeaf69bcb26891f379c21a47743394ce956a5 /src/mongo/db/repl.cpp | |
parent | e9fe81f1d7eef251a9ebee4514031657372cf939 (diff) | |
download | mongo-84df92e10e2458cd4ff3751c620535aa9f9a92b6.tar.gz |
SERVER-8203: replication metrics
Diffstat (limited to 'src/mongo/db/repl.cpp')
-rw-r--r-- | src/mongo/db/repl.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/mongo/db/repl.cpp b/src/mongo/db/repl.cpp index 02d3b2e5e60..55df1adf0d2 100644 --- a/src/mongo/db/repl.cpp +++ b/src/mongo/db/repl.cpp @@ -56,6 +56,7 @@ #include "mongo/db/instance.h" #include "mongo/db/server_parameters.h" #include "mongo/db/queryutil.h" +#include "mongo/base/counter.h" namespace mongo { @@ -257,7 +258,6 @@ namespace mongo { } } replicationInfoServerStatus; - class CmdIsMaster : public Command { public: virtual bool requiresAuth() { return false; } @@ -1207,6 +1207,13 @@ namespace mongo { return true; } + //number of readers created; + // this happens when the source source changes, a reconfig/network-error or the cursor dies + static Counter64 readersCreatedStats; + static ServerStatusMetricField<Counter64> displayReadersCreated( + "repl.network.readersCreated", + &readersCreatedStats ); + OplogReader::OplogReader( bool doHandshake ) : _doHandshake( doHandshake ) { @@ -1215,6 +1222,8 @@ namespace mongo { /* TODO: slaveOk maybe shouldn't use? */ _tailingQueryOptions |= QueryOption_AwaitData; + + readersCreatedStats.increment(); } bool OplogReader::commonConnect(const string& hostName) { |