Monitors a single node process.
More...
#include <node_monitor.h>
Monitors a single node process.
Definition at line 24 of file node_monitor.h.
Enumerator |
---|
CMD_RUN |
|
CMD_STOP |
|
CMD_RESTART |
|
Definition at line 185 of file node_monitor.h.
Process state.
Enumerator |
---|
STATE_IDLE |
Idle (e.g. exited with code 0)
|
STATE_RUNNING |
Running.
|
STATE_CRASHED |
Crashed (i.e. exited with code != 0)
|
STATE_WAITING |
Waiting for automatic restart after crash.
|
Definition at line 31 of file node_monitor.h.
rosmon::monitor::NodeMonitor::~NodeMonitor |
( |
| ) |
|
void rosmon::monitor::NodeMonitor::addCPUTime |
( |
uint64_t |
userTime, |
|
|
uint64_t |
systemTime |
|
) |
| |
void rosmon::monitor::NodeMonitor::addMemory |
( |
uint64_t |
memoryBytes | ) |
|
void rosmon::monitor::NodeMonitor::beginStatUpdate |
( |
| ) |
|
void rosmon::monitor::NodeMonitor::checkStop |
( |
| ) |
|
|
private |
void rosmon::monitor::NodeMonitor::communicate |
( |
| ) |
|
|
private |
std::vector< std::string > rosmon::monitor::NodeMonitor::composeCommand |
( |
| ) |
const |
|
private |
bool rosmon::monitor::NodeMonitor::coredumpAvailable |
( |
| ) |
const |
|
inline |
Is a core dump available from a crash under rosmon control?
Definition at line 88 of file node_monitor.h.
float rosmon::monitor::NodeMonitor::cpuLimit |
( |
| ) |
const |
|
inline |
std::string rosmon::monitor::NodeMonitor::debuggerCommand |
( |
| ) |
const |
|
inline |
void rosmon::monitor::NodeMonitor::endStatUpdate |
( |
uint64_t |
elapsedTime | ) |
|
void rosmon::monitor::NodeMonitor::forceExit |
( |
| ) |
|
Finish shutdown sequence.
If the node is still running, this sends SIGKILL and prints a warning.
Definition at line 322 of file node_monitor.cpp.
void rosmon::monitor::NodeMonitor::gatherCoredump |
( |
int |
signal | ) |
|
|
private |
void rosmon::monitor::NodeMonitor::launchDebugger |
( |
| ) |
|
Launch gdb interactively.
This opens gdb in a new terminal window. If X11 is not available, the gdb command is emitted via logMessageSignal().
If a coredump is available (see coredumpAvailable()), gdb is launched against the coredump instead of the running process.
Definition at line 582 of file node_monitor.cpp.
template<typename... Args>
void rosmon::monitor::NodeMonitor::log |
( |
const char * |
format, |
|
|
const Args &... |
args |
|
) |
| |
|
private |
double rosmon::monitor::NodeMonitor::memory |
( |
| ) |
const |
|
inline |
Total system memory used by the node.
This includes child processes. Only resident memory is counted (i.e. how much physical memory is used).
- Returns
- Memory usage in bytes
Definition at line 145 of file node_monitor.h.
uint64_t rosmon::monitor::NodeMonitor::memoryLimit |
( |
| ) |
const |
|
inline |
std::string rosmon::monitor::NodeMonitor::name |
( |
| ) |
const |
|
inline |
std::string rosmon::monitor::NodeMonitor::namespaceString |
( |
| ) |
const |
|
inline |
int rosmon::monitor::NodeMonitor::pid |
( |
| ) |
const |
|
inline |
void rosmon::monitor::NodeMonitor::restart |
( |
| ) |
|
unsigned int rosmon::monitor::NodeMonitor::restartCount |
( |
| ) |
const |
|
inline |
bool rosmon::monitor::NodeMonitor::running |
( |
| ) |
const |
void rosmon::monitor::NodeMonitor::shutdown |
( |
| ) |
|
Start shutdown sequence.
If the node is still running, this sends SIGINT.
Definition at line 314 of file node_monitor.cpp.
void rosmon::monitor::NodeMonitor::start |
( |
| ) |
|
void rosmon::monitor::NodeMonitor::stop |
( |
bool |
restart = false | ) |
|
double rosmon::monitor::NodeMonitor::stopTimeout |
( |
| ) |
const |
|
inline |
double rosmon::monitor::NodeMonitor::systemLoad |
( |
| ) |
const |
|
inline |
Estimate of the kernelspace load.
This is the fraction of CPU time spent in kernelspace code of this node. Note that this value is relative to one CPU core.
Definition at line 134 of file node_monitor.h.
double rosmon::monitor::NodeMonitor::userLoad |
( |
| ) |
const |
|
inline |
Estimate of the userspace load.
This is the fraction of CPU time spent in userspace code of this node. Note that this value is relative to one CPU core.
Definition at line 125 of file node_monitor.h.
boost::signals2::signal<void(std::string)> rosmon::monitor::NodeMonitor::exitedSignal |
boost::signals2::signal<void(std::string,std::string)> rosmon::monitor::NodeMonitor::logMessageSignal |
Logging signal.
Contains a log message (node name, message) to be printed or saved in a log file.
Definition at line 180 of file node_monitor.h.
Command rosmon::monitor::NodeMonitor::m_command |
|
private |
std::string rosmon::monitor::NodeMonitor::m_debuggerCommand |
|
private |
int rosmon::monitor::NodeMonitor::m_exitCode |
|
private |
int rosmon::monitor::NodeMonitor::m_fd = -1 |
|
private |
uint64_t rosmon::monitor::NodeMonitor::m_memory = 0 |
|
private |
int rosmon::monitor::NodeMonitor::m_pid = -1 |
|
private |
std::string rosmon::monitor::NodeMonitor::m_processWorkingDirectory |
|
private |
bool rosmon::monitor::NodeMonitor::m_processWorkingDirectoryCreated = false |
|
private |
unsigned int rosmon::monitor::NodeMonitor::m_restartCount = 0 |
|
private |
bool rosmon::monitor::NodeMonitor::m_restarting |
|
private |
boost::circular_buffer<char> rosmon::monitor::NodeMonitor::m_rxBuffer |
|
private |
double rosmon::monitor::NodeMonitor::m_systemLoad = 0.0 |
|
private |
uint64_t rosmon::monitor::NodeMonitor::m_systemTime = 0 |
|
private |
double rosmon::monitor::NodeMonitor::m_userLoad = 0.0 |
|
private |
uint64_t rosmon::monitor::NodeMonitor::m_userTime = 0 |
|
private |
The documentation for this class was generated from the following files: