| 12345678910111213141516171819202122232425262728293031323334353637 | #pragma once#include <map>#include <mutex>#include "collectable.h"#include "cpp/metrics.pb.h"#include "family.h"#include "histogram.h"namespace prometheus {class Counter;class Gauge;class Registry : public Collectable { public:  Registry() = default;  Registry(const std::map<std::string, std::string>& constLabels);  Family<Counter>* add_counter(      const std::string& name, const std::string& help,      const std::map<std::string, std::string>& labels);  Family<Gauge>* add_gauge(const std::string& name, const std::string& help,                           const std::map<std::string, std::string>& labels);  Family<Histogram>* add_histogram(      const std::string& name, const std::string& help,      const std::map<std::string, std::string>& labels);  // collectable  std::vector<io::prometheus::client::MetricFamily> collect() override; private:  std::vector<std::unique_ptr<Collectable>> collectables_;  std::map<std::string, std::string> constLabels_;  std::mutex mutex_;};}
 |