summaryrefslogtreecommitdiff
path: root/src/mongo/db/commands/server_status_metric.h
diff options
context:
space:
mode:
authorMark Benvenuto <mark.benvenuto@mongodb.com>2015-06-20 00:22:50 -0400
committerMark Benvenuto <mark.benvenuto@mongodb.com>2015-06-20 10:56:02 -0400
commit9c2ed42daa8fbbef4a919c21ec564e2db55e8d60 (patch)
tree3814f79c10d7b490948d8cb7b112ac1dd41ceff1 /src/mongo/db/commands/server_status_metric.h
parent01965cf52bce6976637ecb8f4a622aeb05ab256a (diff)
downloadmongo-9c2ed42daa8fbbef4a919c21ec564e2db55e8d60.tar.gz
SERVER-18579: Clang-Format - reformat code, no comment reflow
Diffstat (limited to 'src/mongo/db/commands/server_status_metric.h')
-rw-r--r--src/mongo/db/commands/server_status_metric.h93
1 files changed, 47 insertions, 46 deletions
diff --git a/src/mongo/db/commands/server_status_metric.h b/src/mongo/db/commands/server_status_metric.h
index 239c66fa96b..83fc5eff452 100644
--- a/src/mongo/db/commands/server_status_metric.h
+++ b/src/mongo/db/commands/server_status_metric.h
@@ -36,56 +36,57 @@
namespace mongo {
- class ServerStatusMetric {
- public:
- /**
- * @param name is a dotted path of a counter name
- * if name starts with . its treated as a path from the serverStatus root
- * otherwise it will live under the "counters" namespace
- * so foo.bar would be serverStatus().counters.foo.bar
- */
- ServerStatusMetric(const std::string& name);
- virtual ~ServerStatusMetric(){}
-
- std::string getMetricName() const { return _name; }
-
- virtual void appendAtLeaf( BSONObjBuilder& b ) const = 0;
-
- protected:
- static std::string _parseLeafName( const std::string& name );
-
- const std::string _name;
- const std::string _leafName;
- };
-
+class ServerStatusMetric {
+public:
/**
- * usage
- *
- * declared once
- * Counter counter;
- * ServerStatusMetricField myAwesomeCounterDisplay( "path.to.counter", &counter );
- *
- * call
- * counter.hit();
- *
- * will show up in db.serverStatus().metrics.path.to.counter
+ * @param name is a dotted path of a counter name
+ * if name starts with . its treated as a path from the serverStatus root
+ * otherwise it will live under the "counters" namespace
+ * so foo.bar would be serverStatus().counters.foo.bar
*/
- template< typename T >
- class ServerStatusMetricField : public ServerStatusMetric {
- public:
- ServerStatusMetricField( const std::string& name, const T* t )
- : ServerStatusMetric(name), _t(t) {
- }
+ ServerStatusMetric(const std::string& name);
+ virtual ~ServerStatusMetric() {}
- const T* get() { return _t; }
+ std::string getMetricName() const {
+ return _name;
+ }
- virtual void appendAtLeaf( BSONObjBuilder& b ) const {
- b.append( _leafName, *_t );
- }
+ virtual void appendAtLeaf(BSONObjBuilder& b) const = 0;
- private:
- const T* _t;
- };
+protected:
+ static std::string _parseLeafName(const std::string& name);
-}
+ const std::string _name;
+ const std::string _leafName;
+};
+/**
+ * usage
+ *
+ * declared once
+ * Counter counter;
+ * ServerStatusMetricField myAwesomeCounterDisplay( "path.to.counter", &counter );
+ *
+ * call
+ * counter.hit();
+ *
+ * will show up in db.serverStatus().metrics.path.to.counter
+ */
+template <typename T>
+class ServerStatusMetricField : public ServerStatusMetric {
+public:
+ ServerStatusMetricField(const std::string& name, const T* t)
+ : ServerStatusMetric(name), _t(t) {}
+
+ const T* get() {
+ return _t;
+ }
+
+ virtual void appendAtLeaf(BSONObjBuilder& b) const {
+ b.append(_leafName, *_t);
+ }
+
+private:
+ const T* _t;
+};
+}