CPUSegment.h
Go to the documentation of this file.
1
#pragma once
2
3
// STD/STL
4
#include <iostream>
5
#include <csignal>
6
#include <memory>
7
#include <atomic>
8
#include <thread>
9
10
// System Monitor
11
#include "
LightweightSystemMonitor/linux_memoryload.hpp
"
12
#include "
LightweightSystemMonitor/linux_cpuload.hpp
"
13
#include "
LightweightSystemMonitor/linux_process_load.hpp
"
14
#include "
LightweightSystemMonitor/linux_networkload.hpp
"
15
#include "
LightweightSystemMonitor/linux_systemutil.hpp
"
16
#include "
LightweightSystemMonitor/util/record_value.hpp
"
17
#include "
LightweightSystemMonitor/util/timer.hpp
"
18
19
// BaseClass
20
#include <
RobotAPI/libraries/armem/server/segment/SpecializedProviderSegment.h
>
21
22
// ArmarX
23
#include <
ArmarXCore/core/services/tasks/PeriodicTask.h
>
24
25
namespace
armarx::armem::server::systemstate::segment
26
{
27
class
LightweightCpuMonitorProviderSegment
:
public
armem::server::segment::SpecializedProviderSegment
28
{
29
using
Base
=
armem::server::segment::SpecializedProviderSegment
;
30
31
public
:
32
LightweightCpuMonitorProviderSegment
(
armem::server::MemoryToIceAdapter
&
iceMemory
);
33
34
void
defineProperties
(
armarx::PropertyDefinitionsPtr
defs,
const
std::string& prefix =
""
)
override
;
35
void
init
()
override
;
36
37
private
:
38
void
loop();
39
40
private
:
41
float
pollFrequencyHz = 10.0;
42
std::unique_ptr<cpuLoad> cpuMonitoring = std::make_unique<cpuLoad>(
"/proc/stat"
);
43
44
armarx::PeriodicTask<LightweightCpuMonitorProviderSegment>::pointer_type
runningTask;
45
};
46
}
linux_memoryload.hpp
armarx::armem::server::systemstate::segment::LightweightCpuMonitorProviderSegment::LightweightCpuMonitorProviderSegment
LightweightCpuMonitorProviderSegment(armem::server::MemoryToIceAdapter &iceMemory)
Definition:
CPUSegment.cpp:16
armarx::armem::server::MemoryToIceAdapter
Helps connecting a Memory server to the Ice interface.
Definition:
MemoryToIceAdapter.h:19
linux_cpuload.hpp
PeriodicTask.h
armarx::armem::server::segment::SpecializedProviderSegment
A base class for provider segments.
Definition:
SpecializedProviderSegment.h:20
linux_process_load.hpp
linux_systemutil.hpp
timer.hpp
armarx::armem::server::systemstate::segment::LightweightCpuMonitorProviderSegment
Definition:
CPUSegment.h:27
armarx::armem::server::segment::detail::SegmentBase< server::wm::ProviderSegment >
linux_networkload.hpp
armarx::armem::server::systemstate::segment::LightweightCpuMonitorProviderSegment::init
void init() override
Definition:
CPUSegment.cpp:27
armarx::armem::server::segment::detail::SegmentBase< server::wm::ProviderSegment >::iceMemory
MemoryToIceAdapter & iceMemory
Definition:
SpecializedSegment.h:60
armarx::armem::server::systemstate::segment::LightweightCpuMonitorProviderSegment::defineProperties
void defineProperties(armarx::PropertyDefinitionsPtr defs, const std::string &prefix="") override
Definition:
CPUSegment.cpp:22
IceUtil::Handle< class PropertyDefinitionContainer >
SpecializedProviderSegment.h
record_value.hpp
armarx::armem::server::systemstate::segment
Definition:
CPUSegment.cpp:14
RobotAPI
libraries
armem_system_state
server
CPUSegment.h
Generated on Sat Oct 12 2024 09:14:09 for armarx_documentation by
1.8.17