136 return std::make_unique<plugin_collector_adapter<T>>();
149 return std::make_unique<crtp_collector_adapter<T>>();
162 return std::make_unique<standalone_collector_adapter<T>>();
Base interface for type-erased collectors.
Adapter for CRTP-based collectors (collector_base<T>)
bool is_healthy() const override
bool initialize(const config_map &config) override
std::vector< std::string > get_metric_types() const override
T * get_collector()
Get the underlying collector.
std::unique_ptr< T > collector_
std::string get_name() const override
const T * get_collector() const
static metric_factory & instance()
Get the singleton instance.
bool register_collector(const std::string &name, collector_factory_fn factory)
Register a collector factory function.
Adapter for plugin-based collectors (metric_collector_plugin)
T * get_collector()
Get the underlying collector.
plugin_collector_adapter()
bool is_healthy() const override
std::string get_name() const override
bool initialize(const config_map &config) override
const T * get_collector() const
std::unique_ptr< T > collector_
std::vector< std::string > get_metric_types() const override
Adapter for standalone collectors (like vm_collector)
std::vector< std::string > get_metric_types() const override
bool initialize(const config_map &config) override
bool is_healthy() const override
const T * get_collector() const
std::string get_name() const override
standalone_collector_adapter()
T * get_collector()
Get the underlying collector.
std::unique_ptr< T > collector_
Unified factory for metric collector instantiation.
bool register_standalone_collector(const std::string &name)
Helper function to register a standalone collector.
bool register_crtp_collector(const std::string &name)
Helper function to register a CRTP-based collector.
bool register_plugin_collector(const std::string &name)
Helper function to register a plugin-based collector.
std::unordered_map< std::string, std::string > config_map
Type alias for configuration map.