Monitoring System 0.1.0
System resource monitoring with pluggable collectors and alerting
Loading...
Searching...
No Matches
power_collector.h File Reference

Power consumption monitoring collector. More...

#include <atomic>
#include <chrono>
#include <cstdint>
#include <memory>
#include <mutex>
#include <string>
#include <unordered_map>
#include <vector>
#include "../interfaces/metric_types_adapter.h"
#include "../plugins/collector_plugin.h"
Include dependency graph for power_collector.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  kcenon::monitoring::power_source_info
 Information about a power source. More...
 
struct  kcenon::monitoring::power_reading
 A single power reading from a source. More...
 
class  kcenon::monitoring::power_info_collector
 Power data collector using platform abstraction layer. More...
 
class  kcenon::monitoring::power_collector
 Power consumption monitoring collector implementing collector_plugin interface. More...
 

Namespaces

namespace  kcenon
 
namespace  kcenon::monitoring
 
namespace  kcenon::monitoring::platform
 

Enumerations

enum class  kcenon::monitoring::power_source_type {
  kcenon::monitoring::unknown , kcenon::monitoring::battery , kcenon::monitoring::ac , kcenon::monitoring::usb ,
  kcenon::monitoring::wireless , kcenon::monitoring::cpu , kcenon::monitoring::gpu , kcenon::monitoring::memory ,
  kcenon::monitoring::package , kcenon::monitoring::platform , kcenon::monitoring::other
}
 Type of power source. More...
 

Functions

std::string kcenon::monitoring::power_source_type_to_string (power_source_type type)
 Convert power_source_type to string representation.
 

Detailed Description

Power consumption monitoring collector.

This file provides power consumption monitoring using platform-specific APIs to gather power and energy data:

  • Linux: RAPL (Running Average Power Limit) via /sys/class/powercap/intel-rapl/ and /sys/class/power_supply/ for battery info
  • macOS: IOKit SMC (System Management Controller)
  • Windows: WMI (Win32_Battery) for battery metrics

Definition in file power_collector.h.