diff options
Diffstat (limited to 'src/mongo/db/commands.cpp')
-rw-r--r-- | src/mongo/db/commands.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/mongo/db/commands.cpp b/src/mongo/db/commands.cpp index 2ef8db5085a..72508f89de5 100644 --- a/src/mongo/db/commands.cpp +++ b/src/mongo/db/commands.cpp @@ -62,6 +62,10 @@ namespace mongo { int Command::testCommandsEnabled = 0; + Counter64 Command::unknownCommands; + static ServerStatusMetricField<Counter64> displayUnknownCommands( "commands.<UNKNOWN>", + &Command::unknownCommands ); + namespace { ExportedServerParameter<int> testCommandsParameter(ServerParameterSet::getGlobal(), "enableTestCommands", @@ -176,7 +180,10 @@ namespace mongo { ss << "</tr>\n"; } - Command::Command(StringData _name, bool web, StringData oldName) : name(_name.toString()) { + Command::Command(StringData _name, bool web, StringData oldName) : + name(_name.toString()), + _commandsExecutedMetric("commands."+ _name.toString()+".total", &_commandsExecuted), + _commandsFailedMetric("commands."+ _name.toString()+".failed", &_commandsFailed) { // register ourself. if ( _commands == 0 ) _commands = new map<string,Command*>; |