Monitoring System 0.1.0
System resource monitoring with pluggable collectors and alerting
Loading...
Searching...
No Matches
test_interfaces_compile.cpp File Reference

Compilation test for new monitoring interfaces. More...

Include dependency graph for test_interfaces_compile.cpp:

Go to the source code of this file.

Classes

class  test_observer
 
class  test_collector
 

Functions

int main ()
 

Detailed Description

Compilation test for new monitoring interfaces.

This test ensures that all new interface headers compile correctly and can be included without errors.

Definition in file test_interfaces_compile.cpp.

Function Documentation

◆ main()

int main ( )
Examples
alert_notifiers_example.cpp, alert_pipeline_example.cpp, alert_triggers_example.cpp, basic_monitoring_example.cpp, bidirectional_di_example.cpp, collector_factory_example.cpp, custom_metric_types_example.cpp, distributed_tracing_example.cpp, event_bus_example.cpp, facade_adapter_poc.cpp, graceful_degradation_example.cpp, health_reliability_example.cpp, logger_di_integration_example.cpp, monitor_factory_pattern_example.cpp, multi_service_tracing_example.cpp, otlp_export_example.cpp, platform_metrics_example.cpp, plugin_collector_example.cpp, plugin_example/plugin_loader_example.cpp, production_monitoring_example.cpp, result_pattern_example.cpp, storage_example.cpp, system_collectors_example.cpp, and time_series_storage_example.cpp.

Definition at line 96 of file test_interfaces_compile.cpp.

96 {
97 std::cout << "=== Interface Compilation Test ===" << std::endl;
98
99 // Test that interfaces can be instantiated through implementations
100 auto observer = std::make_shared<test_observer>();
101 auto collector = std::make_shared<test_collector>();
102
103 // Test that interfaces can be used
104 metric m{"test", 42.0, {}};
105 metric_event me("test_source", m);
106 observer->on_metric_collected(me);
107
108 system_event se(system_event::event_type::component_started, "test_component", "Started");
109 observer->on_event_occurred(se);
110
111 state_change_event sce("test_component",
112 state_change_event::state::healthy,
113 state_change_event::state::degraded);
114 observer->on_system_state_changed(sce);
115
116 // Test collector interface
117 auto result = collector->collect_metrics();
118 if (result.is_ok()) {
119 std::cout << "Metrics collected successfully" << std::endl;
120 }
121
122 auto types = collector->get_metric_types();
123 std::cout << "Collector supports " << types.size() << " metric type(s)" << std::endl;
124
125 std::cout << "✅ All interface compilation tests passed!" << std::endl;
126
127 return 0;
128}
Event fired when a metric is collected.
Event fired when system state changes.
Generic system event for monitoring components.
Basic metric structure for interface compatibility.