|
Monitoring System 0.1.0
System resource monitoring with pluggable collectors and alerting
|
Coordinates multiple resource management components. More...
#include <resource_manager.h>

Public Member Functions | |
| resource_manager (const std::string &name) | |
| common::Result< bool > | add_rate_limiter (const std::string &name, const rate_limit_config &config) |
| Add a rate limiter. | |
| rate_limiter * | get_rate_limiter (const std::string &name) |
| Get a rate limiter by name. | |
| common::Result< bool > | add_memory_quota (const std::string &name, const resource_quota "a) |
| Add a memory quota manager. | |
| memory_quota_manager * | get_memory_quota (const std::string &name) |
| Get a memory quota manager by name. | |
| common::Result< bool > | add_cpu_throttler (const std::string &name, const cpu_throttle_config &config) |
| Add a CPU throttler. | |
| cpu_throttler * | get_cpu_throttler (const std::string &name) |
| Get a CPU throttler by name. | |
| common::Result< bool > | is_healthy () const |
| Check if all resources are healthy. | |
| std::unordered_map< std::string, resource_metrics > | get_all_metrics () const |
| Get metrics for all managed resources. | |
Private Attributes | |
| std::string | name_ |
| std::unordered_map< std::string, std::unique_ptr< rate_limiter > > | rate_limiters_ |
| std::unordered_map< std::string, std::unique_ptr< memory_quota_manager > > | memory_quotas_ |
| std::unordered_map< std::string, std::unique_ptr< cpu_throttler > > | cpu_throttlers_ |
| std::mutex | mutex_ |
Coordinates multiple resource management components.
Definition at line 459 of file resource_manager.h.
|
inlineexplicit |
Definition at line 461 of file resource_manager.h.
|
inline |
Add a CPU throttler.
| name | Name for the throttler |
| config | CPU throttle configuration |
Definition at line 528 of file resource_manager.h.
References kcenon::monitoring::already_exists, cpu_throttlers_, and mutex_.
|
inline |
Add a memory quota manager.
| name | Name for the manager |
| quota | Resource quota configuration |
Definition at line 499 of file resource_manager.h.
References kcenon::monitoring::already_exists, memory_quotas_, and mutex_.
|
inline |
Add a rate limiter.
| name | Name for the limiter |
| config | Rate limit configuration |
Definition at line 469 of file resource_manager.h.
References kcenon::monitoring::already_exists, kcenon::monitoring::rate_limit_config::burst_capacity, mutex_, rate_limiters_, kcenon::monitoring::rate_limit_config::rate_per_second, and kcenon::monitoring::rate_limit_config::strategy.
|
inline |
Get metrics for all managed resources.
Definition at line 571 of file resource_manager.h.
References cpu_throttlers_, memory_quotas_, mutex_, and rate_limiters_.
|
inline |
Get a CPU throttler by name.
| name | Name of the throttler |
Definition at line 545 of file resource_manager.h.
References cpu_throttlers_, and mutex_.
|
inline |
Get a memory quota manager by name.
| name | Name of the manager |
Definition at line 516 of file resource_manager.h.
References memory_quotas_, and mutex_.
|
inline |
Get a rate limiter by name.
| name | Name of the limiter |
Definition at line 487 of file resource_manager.h.
References mutex_, and rate_limiters_.
|
inline |
Check if all resources are healthy.
Definition at line 555 of file resource_manager.h.
References memory_quotas_, and mutex_.
|
private |
Definition at line 594 of file resource_manager.h.
Referenced by add_cpu_throttler(), get_all_metrics(), and get_cpu_throttler().
|
private |
Definition at line 593 of file resource_manager.h.
Referenced by add_memory_quota(), get_all_metrics(), get_memory_quota(), and is_healthy().
|
mutableprivate |
Definition at line 595 of file resource_manager.h.
Referenced by add_cpu_throttler(), add_memory_quota(), add_rate_limiter(), get_all_metrics(), get_cpu_throttler(), get_memory_quota(), get_rate_limiter(), and is_healthy().
|
private |
Definition at line 591 of file resource_manager.h.
|
private |
Definition at line 592 of file resource_manager.h.
Referenced by add_rate_limiter(), get_all_metrics(), and get_rate_limiter().