|
lintel 0.2.0
|
#include <Process.h>
Represents a managed process with lifecycle callbacks, auto-restart capability and configurable automation policy (backoff, rate limit, periodic restart, active time window and resource notify thresholds).
|
explicit |
Constructor.
| path | path to the executable |
| args | command-line arguments |
| configName | bootstrap config name used by the child process (empty = inherit) |
| void lintel::Process::addOnFinishEvent | ( | std::shared_ptr< std::function< void(const Process &)> > | onFinish | ) |
| onFinish | callback invoked when the process finishes |
| void lintel::Process::addOnRestartEvent | ( | std::shared_ptr< std::function< void(const Process &)> > | onRestart | ) |
| onRestart | callback invoked when the process restarts |
| void lintel::Process::addOnStartEvent | ( | std::shared_ptr< std::function< void(const Process &)> > | onStart | ) |
| onStart | callback invoked when the process starts |
| void lintel::Process::addOnStopEvent | ( | std::shared_ptr< std::function< void(const Process &)> > | onStop | ) |
| onStop | callback invoked when the process stops |
| void lintel::Process::addOnTerminateEvent | ( | std::shared_ptr< std::function< void(const Process &)> > | onTerminate | ) |
| onTerminate | callback invoked when the process is terminated |
| int lintel::Process::currentRestarts | ( | ) | const |
| void lintel::Process::disableAutoStart | ( | ) |
Disable auto-restart for the process.
Enable auto-restart for the process.
| maxAutoRestarts | maximum number of restarts (-1 for unlimited) |
| std::optional< int32_t > lintel::Process::getActiveFromHour | ( | ) | const |
| std::optional< int32_t > lintel::Process::getActiveToHour | ( | ) | const |
| const std::vector< std::string > & lintel::Process::getArgs | ( | ) | const |
| const std::string & lintel::Process::getConfigName | ( | ) | const |
| std::optional< double > lintel::Process::getCpuNotify | ( | ) | const |
| int lintel::Process::getMaxAutoRestarts | ( | ) | const |
| int lintel::Process::getMaxRestartRate | ( | ) | const |
| std::optional< uint64_t > lintel::Process::getMemoryNotify | ( | ) | const |
| std::chrono::milliseconds lintel::Process::getMinUptime | ( | ) | const |
| const std::filesystem::path & lintel::Process::getPath | ( | ) | const |
| std::chrono::milliseconds lintel::Process::getRestartDelay | ( | ) | const |
| std::chrono::milliseconds lintel::Process::getRestartDelayMax | ( | ) | const |
| std::chrono::milliseconds lintel::Process::getRestartInterval | ( | ) | const |
| std::chrono::milliseconds lintel::Process::getRestartWindow | ( | ) | const |
| bool lintel::Process::hasActiveWindow | ( | ) | const |
| bool lintel::Process::inActiveWindow | ( | ) | const |
| void lintel::Process::increaseRestarts | ( | ) |
Increment the restart counter.
| bool lintel::Process::isAutoRestart | ( | ) | const |
| void lintel::Process::onFinish | ( | ) | const |
Trigger the onFinish event.
| void lintel::Process::onRestart | ( | ) | const |
Trigger the onRestart event.
| void lintel::Process::onStart | ( | ) | const |
Trigger the onStart event.
| void lintel::Process::onStop | ( | ) | const |
Trigger the onStop event.
| void lintel::Process::onTerminate | ( | ) | const |
Trigger the onTerminate event.
| void lintel::Process::resetRestarts | ( | ) |
Reset the restart counter to zero.
| activeFromHour | active window start hour (0-23), disabled if nullopt |
| activeToHour | active window end hour (0-23), disabled if nullopt |
| cpuNotify | CPU usage percentage threshold that triggers a notify |
| maxRestartRate | maximum restart count within the rate window (-1 = unlimited) |
| memoryNotify | memory usage threshold in bytes that triggers a notify |
| void lintel::Process::setMinUptime | ( | std::chrono::milliseconds | minUptime | ) |
| minUptime | minimum uptime in the restart window for a crash to count against the rate limit |
| void lintel::Process::setRestartDelay | ( | std::chrono::milliseconds | delay | ) |
| delay | base backoff delay before the next auto-restart (0 = immediate) |
| void lintel::Process::setRestartDelayMax | ( | std::chrono::milliseconds | delayMax | ) |
| delayMax | maximum (capped) backoff delay (0 = no cap) |
| void lintel::Process::setRestartInterval | ( | std::chrono::milliseconds | restartInterval | ) |
| restartInterval | periodic restart interval (0 = disabled) |
| void lintel::Process::setRestartWindow | ( | std::chrono::milliseconds | restartWindow | ) |
| restartWindow | time window over which the restart rate is evaluated |