Monitoring System 0.1.0
System resource monitoring with pluggable collectors and alerting
Loading...
Searching...
No Matches
BufferingStrategiesTest Class Reference

Test suite for Phase 3 P3: Configurable buffering strategies. More...

Inheritance diagram for BufferingStrategiesTest:
Inheritance graph
Collaboration diagram for BufferingStrategiesTest:
Collaboration graph

Protected Member Functions

void SetUp () override
 
void TearDown () override
 
buffered_metric create_test_metric (const std::string &name, double value, uint8_t priority=128)
 Create test metric.
 
std::vector< buffered_metric > create_test_metrics (size_t count, const std::string &base_name="test")
 Create multiple test metrics.
 

Detailed Description

Test suite for Phase 3 P3: Configurable buffering strategies.

Definition at line 20 of file test_buffering_strategies.cpp.

Member Function Documentation

◆ create_test_metric()

buffered_metric BufferingStrategiesTest::create_test_metric ( const std::string & name,
double value,
uint8_t priority = 128 )
inlineprotected

Create test metric.

Definition at line 33 of file test_buffering_strategies.cpp.

33 {
34 // Create metadata with hash of name
35 std::hash<std::string> hasher;
36 uint32_t name_hash = static_cast<uint32_t>(hasher(name));
37 metric_metadata metadata(name_hash, metric_type::gauge);
38 compact_metric_value metric(metadata, value);
39 return buffered_metric(std::move(metric), priority);
40 }
Memory-efficient metric value storage.
Compact metadata for metrics.
Basic metric structure for interface compatibility.

Referenced by create_test_metrics().

Here is the caller graph for this function:

◆ create_test_metrics()

std::vector< buffered_metric > BufferingStrategiesTest::create_test_metrics ( size_t count,
const std::string & base_name = "test" )
inlineprotected

Create multiple test metrics.

Definition at line 45 of file test_buffering_strategies.cpp.

45 {
46 std::vector<buffered_metric> metrics;
47 metrics.reserve(count);
48
49 for (size_t i = 0; i < count; ++i) {
50 std::string name = base_name + "_" + std::to_string(i);
51 metrics.push_back(create_test_metric(name, static_cast<double>(i)));
52 }
53
54 return metrics;
55 }
buffered_metric create_test_metric(const std::string &name, double value, uint8_t priority=128)
Create test metric.

References create_test_metric().

Here is the call graph for this function:

◆ SetUp()

void BufferingStrategiesTest::SetUp ( )
inlineoverrideprotected

Definition at line 22 of file test_buffering_strategies.cpp.

22 {
23 // Common setup for tests
24 }

◆ TearDown()

void BufferingStrategiesTest::TearDown ( )
inlineoverrideprotected

Definition at line 26 of file test_buffering_strategies.cpp.

26 {
27 // Common cleanup for tests
28 }

The documentation for this class was generated from the following file: