diff options
author | Kevin Albertson <kevin.albertson@10gen.com> | 2016-06-23 11:49:38 -0400 |
---|---|---|
committer | Kevin Albertson <kevin.albertson@10gen.com> | 2016-06-24 17:40:02 -0400 |
commit | 6c755905c31ac284d88077500ebba021d20b3626 (patch) | |
tree | 5d9926babdd696004b830a0a1664d58cef4b9e2c /src/mongo/db/commands.h | |
parent | 4d14ddf06f49ff55c90451dcff2da1a6edcaf366 (diff) | |
download | mongo-6c755905c31ac284d88077500ebba021d20b3626.tar.gz |
SERVER-5905 Add operation latency histogram
Diffstat (limited to 'src/mongo/db/commands.h')
-rw-r--r-- | src/mongo/db/commands.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/mongo/db/commands.h b/src/mongo/db/commands.h index 874f728ae21..139f344089e 100644 --- a/src/mongo/db/commands.h +++ b/src/mongo/db/commands.h @@ -78,6 +78,8 @@ protected: public: typedef StringMap<Command*> CommandMap; + enum class ReadWriteType { kCommand, kRead, kWrite }; + /** * Constructs a new command and causes it to be registered with the global commands list. It is * not safe to construct commands other than when the server is starting up. @@ -268,6 +270,16 @@ public: return LogicalOp::opCommand; } + /** + * Returns whether this operation is a read, write, or command. + * + * Commands which implement database read or write logic should override this to return kRead + * or kWrite as appropriate. + */ + virtual ReadWriteType getReadWriteType() const { + return ReadWriteType::kCommand; + } + protected: /** * Appends to "*out" the privileges required to run this command on database "dbname" with |