30#include <unordered_map>
144class metrics_provider;
252 auto name() const -> std::string_view
override {
return "process_metrics_collector"; }
253 auto collect() -> std::vector<metric>
override;
Pure virtual interface for metric collector plugins.
Context switch data collector using platform abstraction layer.
double calculate_rate(uint64_t current_switches)
context_switch_info_collector & operator=(context_switch_info_collector &&)=delete
uint64_t last_system_switches_
bool is_context_switch_monitoring_available() const
context_switch_info_collector(context_switch_info_collector &&)=delete
bool has_previous_sample_
std::unique_ptr< platform::metrics_provider > provider_
std::chrono::steady_clock::time_point last_collection_time_
~context_switch_info_collector()
context_switch_info_collector()
context_switch_info_collector & operator=(const context_switch_info_collector &)=delete
context_switch_metrics collect_metrics()
context_switch_info_collector(const context_switch_info_collector &)=delete
File descriptor data collector using platform abstraction layer.
fd_info_collector(const fd_info_collector &)=delete
fd_info_collector(fd_info_collector &&)=delete
std::unique_ptr< platform::metrics_provider > provider_
bool is_fd_monitoring_available() const
fd_info_collector & operator=(fd_info_collector &&)=delete
fd_metrics collect_metrics()
fd_info_collector & operator=(const fd_info_collector &)=delete
Inode data collector using platform abstraction layer.
inode_metrics collect_metrics()
inode_info_collector(const inode_info_collector &)=delete
std::unique_ptr< platform::metrics_provider > provider_
inode_info_collector & operator=(inode_info_collector &&)=delete
inode_info_collector(inode_info_collector &&)=delete
bool is_inode_monitoring_available() const
inode_info_collector & operator=(const inode_info_collector &)=delete
Unified process-level metrics collector.
auto get_metric_types() const -> std::vector< std::string > override
Get supported metric types.
~process_metrics_collector() override=default
void add_context_switch_metrics(std::vector< metric > &metrics, const context_switch_metrics &cs_data)
bool initialize(const config_map &config) override
Initialize plugin with configuration.
process_metrics_collector & operator=(process_metrics_collector &&)=delete
process_metrics_collector(process_metrics_config config)
auto interval() const -> std::chrono::milliseconds override
Get the collection interval for this plugin.
std::unique_ptr< fd_info_collector > fd_collector_
auto collect() -> std::vector< metric > override
Collect current metrics from this plugin.
std::mutex metrics_mutex_
process_metrics_collector(const process_metrics_collector &)=delete
std::unique_ptr< inode_info_collector > inode_collector_
auto get_statistics() const -> stats_map override
void collect_fd_metrics(std::vector< metric > &metrics)
std::unique_ptr< context_switch_info_collector > cs_collector_
auto is_available() const -> bool override
Check if this plugin is available on the current system.
context_switch_metrics get_last_context_switch_metrics() const
process_metrics_collector & operator=(const process_metrics_collector &)=delete
std::atomic< uint64_t > collection_errors_
bool is_inode_monitoring_available() const
void add_inode_metrics(std::vector< metric > &metrics, const inode_metrics &inode_data)
void collect_inode_metrics(std::vector< metric > &metrics)
process_metrics_collector(process_metrics_collector &&)=delete
process_metrics_collector()
fd_metrics get_last_fd_metrics() const
process_metrics_config config_
auto name() const -> std::string_view override
Get the unique name of this plugin.
bool is_fd_monitoring_available() const
inode_metrics get_last_inode_metrics() const
bool is_context_switch_monitoring_available() const
std::atomic< uint64_t > collection_count_
void collect_context_switch_metrics(std::vector< metric > &metrics)
process_metrics last_metrics_
std::chrono::milliseconds collection_interval_
process_metrics get_last_metrics() const
void add_fd_metrics(std::vector< metric > &metrics, const fd_metrics &fd_data)
Plugin interface for metric collectors.
Adapter for metric types to support interface definitions.
std::unordered_map< std::string, double > stats_map
Type alias for statistics map.
std::unordered_map< std::string, std::string > config_map
Type alias for configuration map.
@ platform
Platform/system power domain.
Aggregated context switch metrics for system and process.
uint64_t system_context_switches_total
double context_switches_per_sec
std::chrono::system_clock::time_point timestamp
process_context_switch_info process_info
File descriptor usage metrics.
std::chrono::system_clock::time_point timestamp
bool system_metrics_available
Inode usage information for a single filesystem.
std::string filesystem_type
double inodes_usage_percent
Aggregated inode usage metrics for all filesystems.
double average_usage_percent
uint64_t total_inodes_used
std::string max_usage_mount_point
uint64_t total_inodes_free
std::chrono::system_clock::time_point timestamp
std::vector< filesystem_inode_info > filesystems
Context switch information for the current process.
uint64_t nonvoluntary_switches
uint64_t voluntary_switches
Configuration for selective metric collection.
double fd_warning_threshold
double inode_warning_threshold
double context_switch_rate_warning
bool collect_context_switches
double fd_critical_threshold
double inode_critical_threshold
Combined process-level metrics.
std::chrono::system_clock::time_point timestamp
context_switch_metrics context_switches