Monitors a single node process.
More...
#include <node_monitor.h>
Monitors a single node process.
Definition at line 25 of file node_monitor.h.
Enumerator |
---|
CMD_RUN |
|
CMD_STOP |
|
CMD_RESTART |
|
Definition at line 197 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 32 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 |
void rosmon::monitor::NodeMonitor::communicateStderr |
( |
| ) |
|
|
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 89 of file node_monitor.h.
double rosmon::monitor::NodeMonitor::cpuLimit |
( |
| ) |
const |
|
inline |
std::string rosmon::monitor::NodeMonitor::debuggerCommand |
( |
| ) |
const |
|
inline |
void rosmon::monitor::NodeMonitor::endStatUpdate |
( |
double |
elapsedTimeInTicks | ) |
|
void rosmon::monitor::NodeMonitor::forceExit |
( |
| ) |
|
Finish shutdown sequence.
If the node is still running, this sends SIGKILL and prints a warning.
Definition at line 352 of file node_monitor.cpp.
std::string rosmon::monitor::NodeMonitor::fullName |
( |
| ) |
const |
|
inline |
void rosmon::monitor::NodeMonitor::gatherCoredump |
( |
int |
signal | ) |
|
|
private |
bool rosmon::monitor::NodeMonitor::isMuted |
( |
| ) |
const |
|
inline |
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 712 of file node_monitor.cpp.
template<typename... Args>
void rosmon::monitor::NodeMonitor::log |
( |
const char * |
format, |
|
|
Args &&... |
args |
|
) |
| |
|
private |
template<typename... Args>
void rosmon::monitor::NodeMonitor::logTyped |
( |
LogEvent::Type |
type, |
|
|
const char * |
format, |
|
|
Args &&... |
args |
|
) |
| |
|
private |
uint64_t 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 146 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::setMuted |
( |
bool |
muted | ) |
|
void rosmon::monitor::NodeMonitor::shutdown |
( |
| ) |
|
Start shutdown sequence.
If the node is still running, this sends SIGINT.
Definition at line 344 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 135 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 126 of file node_monitor.h.
boost::signals2::signal<void(std::string)> rosmon::monitor::NodeMonitor::exitedSignal |
boost::signals2::signal<void(LogEvent)> 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 192 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 |
bool rosmon::monitor::NodeMonitor::m_firstStart = true |
|
private |
std::string rosmon::monitor::NodeMonitor::m_lastWorkingDirectory |
|
private |
uint64_t rosmon::monitor::NodeMonitor::m_memory = 0 |
|
private |
bool rosmon::monitor::NodeMonitor::m_muted = false |
|
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 |
boost::circular_buffer<char> rosmon::monitor::NodeMonitor::m_stderrBuffer |
|
private |
int rosmon::monitor::NodeMonitor::m_stderrFD = -1 |
|
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: