4 #ifndef ROSMON_MONITOR_NODE_MONITOR_H 5 #define ROSMON_MONITOR_NODE_MONITOR_H 7 #include "../launch/node.h" 8 #include "../fd_watcher.h" 12 #include <boost/signals2.hpp> 13 #include <boost/circular_buffer.hpp> 27 typedef std::shared_ptr<NodeMonitor>
Ptr;
115 void addCPUTime(uint64_t userTime, uint64_t systemTime);
160 inline std::string
name()
const 196 template<
typename... Args>
197 void log(
const char* format,
const Args& ... args);
std::shared_ptr< const Node > ConstPtr
std::string m_debuggerCommand
boost::signals2::signal< void(std::string)> exitedSignal
Signalled whenever the process exits.
void start()
Start the node.
void forceExit()
Finish shutdown sequence.
double stopTimeout() const
Node stop timeout.
double userLoad() const
Estimate of the userspace load.
Monitors a single node process.
void addMemory(uint64_t memoryBytes)
void stop(bool restart=false)
Stop the node.
boost::circular_buffer< char > m_rxBuffer
std::shared_ptr< NodeMonitor > ConstPtr
unsigned int restartCount() const
double systemLoad() const
Estimate of the kernelspace load.
std::string m_processWorkingDirectory
bool coredumpAvailable() const
Is a core dump available from a crash under rosmon control?
NodeMonitor(launch::Node::ConstPtr launchNode, FDWatcher::Ptr fdWatcher, ros::NodeHandle &nh)
Constructor.
void addCPUTime(uint64_t userTime, uint64_t systemTime)
Idle (e.g. exited with code 0)
std::string namespaceString() const
Node namespace.
void gatherCoredump(int signal)
unsigned int m_restartCount
void launchDebugger()
Launch gdb interactively.
Waiting for automatic restart after crash.
void log(const char *format, const Args &...args)
FDWatcher::Ptr m_fdWatcher
int pid() const
Node PID.
uint64_t memoryLimit() const
std::string debuggerCommand() const
What command should we use to debug the coredump?
ros::WallTimer m_stopCheckTimer
void shutdown()
Start shutdown sequence.
bool running() const
Is the node running?
std::vector< std::string > composeCommand() const
void endStatUpdate(uint64_t elapsedTime)
launch::Node::ConstPtr m_launchNode
Crashed (i.e. exited with code != 0)
State state() const
Get process state.
boost::signals2::signal< void(std::string, std::string)> logMessageSignal
Logging signal.
bool m_processWorkingDirectoryCreated
void restart()
Restart the node.
std::string name() const
Node name.
ros::WallTimer m_restartTimer
double memory() const
Total system memory used by the node.
std::shared_ptr< NodeMonitor > Ptr