Throttles operations based on CPU usage.
More...
#include <resource_manager.h>
Throttles operations based on CPU usage.
Definition at line 412 of file resource_manager.h.
◆ cpu_throttler()
| kcenon::monitoring::cpu_throttler::cpu_throttler |
( |
const std::string & | name, |
|
|
const cpu_throttle_config & | config ) |
|
inline |
◆ execute()
template<typename Func >
| auto kcenon::monitoring::cpu_throttler::execute |
( |
Func && | func | ) |
-> decltype(func()) |
|
inline |
Execute a function with CPU throttling.
- Template Parameters
-
| Func | Function type that returns common::Result<T> |
- Parameters
-
- Returns
- Result of the function or error if throttled
Definition at line 424 of file resource_manager.h.
424 {
425
426
428
429 return std::forward<Func>(func)();
430 }
resource_metrics metrics_
std::atomic< size_t > total_allocations
References metrics_, and kcenon::monitoring::resource_metrics::total_allocations.
◆ get_metrics()
◆ get_name()
| const std::string & kcenon::monitoring::cpu_throttler::get_name |
( |
| ) |
const |
|
inline |
◆ config_
◆ metrics_
◆ name_
| std::string kcenon::monitoring::cpu_throttler::name_ |
|
private |
The documentation for this class was generated from the following file: