Monitoring System 0.1.0
System resource monitoring with pluggable collectors and alerting
Loading...
Searching...
No Matches
kcenon::monitoring::resource_quota Struct Reference

Configuration for resource quotas. More...

#include <resource_manager.h>

Collaboration diagram for kcenon::monitoring::resource_quota:
Collaboration graph

Public Member Functions

 resource_quota ()=default
 
 resource_quota (resource_type t, size_t max, throttling_strategy s=throttling_strategy::reject)
 
bool validate () const
 Validate configuration.
 

Public Attributes

resource_type type = resource_type::memory
 
size_t max_value = 0
 Maximum allowed resource usage.
 
size_t warning_threshold = 0
 Warning level threshold.
 
size_t critical_threshold = 0
 Critical level threshold.
 
throttling_strategy strategy = throttling_strategy::reject
 

Detailed Description

Configuration for resource quotas.

Definition at line 103 of file resource_manager.h.

Constructor & Destructor Documentation

◆ resource_quota() [1/2]

kcenon::monitoring::resource_quota::resource_quota ( )
default

◆ resource_quota() [2/2]

kcenon::monitoring::resource_quota::resource_quota ( resource_type t,
size_t max,
throttling_strategy s = throttling_strategy::reject )
inline

Definition at line 111 of file resource_manager.h.

112 : type(t), max_value(max), warning_threshold(max * 70 / 100),
113 critical_threshold(max * 90 / 100), strategy(s) {}
size_t critical_threshold
Critical level threshold.
size_t max_value
Maximum allowed resource usage.
size_t warning_threshold
Warning level threshold.

Member Function Documentation

◆ validate()

bool kcenon::monitoring::resource_quota::validate ( ) const
inline

Validate configuration.

Returns
true if configuration is valid

Definition at line 119 of file resource_manager.h.

119 {
120 if (max_value == 0) {
121 return false;
122 }
124 return false;
125 }
127 return false;
128 }
130 return false;
131 }
132 return true;
133 }

References critical_threshold, max_value, and warning_threshold.

Referenced by TEST_F().

Here is the caller graph for this function:

Member Data Documentation

◆ critical_threshold

size_t kcenon::monitoring::resource_quota::critical_threshold = 0

Critical level threshold.

Definition at line 107 of file resource_manager.h.

Referenced by kcenon::monitoring::memory_quota_manager::is_over_critical_threshold(), TEST_F(), TEST_F(), and validate().

◆ max_value

size_t kcenon::monitoring::resource_quota::max_value = 0

Maximum allowed resource usage.

Definition at line 105 of file resource_manager.h.

Referenced by kcenon::monitoring::memory_quota_manager::allocate(), TEST_F(), and validate().

◆ strategy

throttling_strategy kcenon::monitoring::resource_quota::strategy = throttling_strategy::reject

Definition at line 108 of file resource_manager.h.

◆ type

resource_type kcenon::monitoring::resource_quota::type = resource_type::memory

Definition at line 104 of file resource_manager.h.

Referenced by TEST_F().

◆ warning_threshold

size_t kcenon::monitoring::resource_quota::warning_threshold = 0

Warning level threshold.

Definition at line 106 of file resource_manager.h.

Referenced by kcenon::monitoring::memory_quota_manager::is_over_warning_threshold(), TEST_F(), TEST_F(), and validate().


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