26#include <unordered_map>
62class metrics_provider;
96 std::unique_ptr<platform::metrics_provider>
provider_;
123 auto name() const -> std::string_view
override {
return "interrupt_collector"; }
124 auto collect() -> std::vector<metric>
override;
125 auto interval() const -> std::chrono::milliseconds
override {
return std::chrono::seconds(15); }
132 .description =
"Hardware and software interrupt statistics",
136 .requires_platform_support =
true
Pure virtual interface for metric collector plugins.
Hardware and software interrupt statistics monitoring collector.
std::atomic< size_t > collection_errors_
bool is_interrupt_monitoring_available() const
interrupt_collector(interrupt_collector &&)=delete
interrupt_collector & operator=(interrupt_collector &&)=delete
auto collect() -> std::vector< metric > override
Collect current metrics from this plugin.
auto name() const -> std::string_view override
Get the unique name of this plugin.
interrupt_collector & operator=(const interrupt_collector &)=delete
interrupt_collector(const interrupt_collector &)=delete
auto initialize(const config_map &config) -> bool override
std::atomic< size_t > collection_count_
auto is_available() const -> bool override
Check if this plugin is available on the current system.
auto get_metadata() const -> plugin_metadata override
Get plugin metadata.
auto get_metric_types() const -> std::vector< std::string > override
Get supported metric types.
auto get_statistics() const -> stats_map override
~interrupt_collector() override=default
interrupt_metrics last_metrics_
auto interval() const -> std::chrono::milliseconds override
Get the collection interval for this plugin.
void add_interrupt_metrics(std::vector< metric > &metrics, const interrupt_metrics &data)
interrupt_metrics get_last_metrics() const
std::unique_ptr< interrupt_info_collector > collector_
bool collect_soft_interrupts_
Interrupt data collector using platform abstraction layer.
bool is_interrupt_monitoring_available() const
interrupt_info_collector(const interrupt_info_collector &)=delete
interrupt_info_collector & operator=(interrupt_info_collector &&)=delete
uint64_t prev_interrupts_total_
std::chrono::system_clock::time_point prev_timestamp_
interrupt_metrics collect_metrics()
interrupt_info_collector & operator=(const interrupt_info_collector &)=delete
std::unique_ptr< platform::metrics_provider > provider_
uint64_t prev_soft_interrupts_total_
~interrupt_info_collector()
bool has_previous_sample_
interrupt_info_collector(interrupt_info_collector &&)=delete
interrupt_info_collector()
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.
@ platform
Platform-specific (VM, uptime, interrupts)
std::unordered_map< std::string, std::string > config_map
Type alias for configuration map.
@ platform
Platform/system power domain.
Per-CPU interrupt statistics.
uint64_t interrupt_count
Total interrupts on this CPU.
double interrupts_per_sec
Interrupt rate on this CPU.
uint32_t cpu_id
CPU identifier.
Aggregated interrupt statistics for the system.
std::vector< cpu_interrupt_info > per_cpu
Per-CPU breakdown (optional)
uint64_t interrupts_total
Total hardware interrupt count.
double interrupts_per_sec
Hardware interrupt rate (gauge)
bool metrics_available
Whether interrupt metrics are available.
double soft_interrupts_per_sec
Soft interrupt rate (Linux only)
bool soft_interrupts_available
Whether soft interrupt metrics are available.
uint64_t soft_interrupts_total
Total soft interrupts (Linux only)
std::chrono::system_clock::time_point timestamp
Reading timestamp.