|
Monitoring System 0.1.0
System resource monitoring with pluggable collectors and alerting
|
#include <gtest/gtest.h>#include "kcenon/monitoring/core/result_types.h"#include "kcenon/monitoring/core/error_codes.h"#include "kcenon/monitoring/interfaces/monitoring_core.h"#include <kcenon/common/error/error_codes.h>
Go to the source code of this file.
Classes | |
| class | ResultTypesTest |
| Test basic Result pattern functionality. More... | |
Functions | |
| TEST_F (ResultTypesTest, SuccessResultContainsValue) | |
| TEST_F (ResultTypesTest, ErrorResultContainsError) | |
| TEST_F (ResultTypesTest, ValueOrReturnsDefaultOnError) | |
| TEST_F (ResultTypesTest, MapTransformsSuccessValue) | |
| TEST_F (ResultTypesTest, MapPropagatesError) | |
| TEST_F (ResultTypesTest, AndThenChainsOperations) | |
| TEST_F (ResultTypesTest, ResultVoidSuccess) | |
| TEST_F (ResultTypesTest, ResultVoidError) | |
| TEST_F (ResultTypesTest, ErrorCodeToString) | |
| TEST_F (ResultTypesTest, ErrorInfoWithContext) | |
| TEST_F (ResultTypesTest, MetricsSnapshotOperations) | |
| TEST_F (ResultTypesTest, MonitoringConfigValidation) | |
| TEST_F (ResultTypesTest, ErrorCodesAreInCommonMonitoringBand) | |
| Verify monitoring error codes land in common's reserved negative band [-399, -300] and classify as "MonitoringSystem". | |
| TEST_F (ResultTypesTest, ToCommonErrorPreservesNegativeCode) | |
| Verify to_common_error() preserves the negative code unchanged and that the result classifies as "MonitoringSystem". | |
| TEST_F (ResultTypesTest, HealthCheckResult) | |
| TEST_F | ( | ResultTypesTest | , |
| AndThenChainsOperations | ) |
Definition at line 63 of file test_result_types.cpp.
| TEST_F | ( | ResultTypesTest | , |
| ErrorCodesAreInCommonMonitoringBand | ) |
Verify monitoring error codes land in common's reserved negative band [-399, -300] and classify as "MonitoringSystem".
Regression guard for issue #697: monitoring_error_code was a positive enum, which common's classifier (after #698) rejects as "Invalid" because any code > 0 is out of range. Codes must be negative and within common_system's reserved monitoring band so they are correctly attributed.
Definition at line 168 of file test_result_types.cpp.
| TEST_F | ( | ResultTypesTest | , |
| ErrorCodeToString | ) |
Definition at line 91 of file test_result_types.cpp.
References kcenon::monitoring::error_code_to_string().

| TEST_F | ( | ResultTypesTest | , |
| ErrorInfoWithContext | ) |
Definition at line 98 of file test_result_types.cpp.
| TEST_F | ( | ResultTypesTest | , |
| ErrorResultContainsError | ) |
Definition at line 30 of file test_result_types.cpp.
| TEST_F | ( | ResultTypesTest | , |
| HealthCheckResult | ) |
Definition at line 206 of file test_result_types.cpp.
References kcenon::monitoring::health_check_result::is_healthy(), kcenon::monitoring::health_check_result::issues, and kcenon::monitoring::health_check_result::status.

| TEST_F | ( | ResultTypesTest | , |
| MapPropagatesError | ) |
Definition at line 55 of file test_result_types.cpp.
| TEST_F | ( | ResultTypesTest | , |
| MapTransformsSuccessValue | ) |
Definition at line 47 of file test_result_types.cpp.
| TEST_F | ( | ResultTypesTest | , |
| MetricsSnapshotOperations | ) |
Definition at line 113 of file test_result_types.cpp.
References kcenon::monitoring::metrics_snapshot::add_metric(), kcenon::monitoring::cpu, kcenon::monitoring::metrics_snapshot::get_metric(), kcenon::monitoring::metrics_snapshot::metrics, and kcenon::monitoring::unknown.

| TEST_F | ( | ResultTypesTest | , |
| MonitoringConfigValidation | ) |
Definition at line 128 of file test_result_types.cpp.
References kcenon::monitoring::monitoring_config::buffer_size, kcenon::monitoring::monitoring_config::collection_interval, kcenon::monitoring::monitoring_config::history_size, and kcenon::monitoring::monitoring_config::validate().

| TEST_F | ( | ResultTypesTest | , |
| ResultVoidError | ) |
Definition at line 83 of file test_result_types.cpp.
| TEST_F | ( | ResultTypesTest | , |
| ResultVoidSuccess | ) |
Definition at line 76 of file test_result_types.cpp.
| TEST_F | ( | ResultTypesTest | , |
| SuccessResultContainsValue | ) |
Definition at line 22 of file test_result_types.cpp.
| TEST_F | ( | ResultTypesTest | , |
| ToCommonErrorPreservesNegativeCode | ) |
Verify to_common_error() preserves the negative code unchanged and that the result classifies as "MonitoringSystem".
Definition at line 194 of file test_result_types.cpp.
References kcenon::monitoring::error_info::to_common_error().

| TEST_F | ( | ResultTypesTest | , |
| ValueOrReturnsDefaultOnError | ) |
Definition at line 39 of file test_result_types.cpp.