Class | God::Watch |
In: |
lib/god/watch.rb
|
Parent: | Task |
VALID_STATES | = | [:init, :up, :start, :restart] | The Array of Symbol valid task states. | |
INITIAL_STATE | = | :init | The Sybmol initial state. | |
DEFAULT_KEEPALIVE_INTERVAL | = | 5.seconds | Default Integer interval at which keepalive will runn poll checks. | |
DEFAULT_KEEPALIVE_MEMORY_TIMES | = | [3, 5] | Default Integer or Array of Integers specification of how many times the memory condition must fail before triggering. | |
DEFAULT_KEEPALIVE_CPU_TIMES | = | [3, 5] | Default Integer or Array of Integers specification of how many times the CPU condition must fail before triggering. |
grace | [RW] | Public: The grace period for this process (seconds). |
restart_grace | [RW] | Public: The restart grace period (seconds). |
start_grace | [RW] | Public: The start grace period (seconds). |
stop_grace | [RW] | Public: The stop grace period (seconds). |
Public: A set of conditions for easily getting started with simple watch scenarios. Keepalive is intended for use by beginners or on processes that do not need very sophisticated monitoring.
If events are enabled, it will use the :process_exit event to determine if a process fails. Otherwise it will use the :process_running poll.
options - The option Hash. Possible values are:
:interval - The Integer number of seconds on which to poll for process status. Affects CPU, memory, and :process_running conditions (if used). Default: 5.seconds. :memory_max - The Integer memory max. A bare integer means kilobytes. You may use Numeric.kilobytes, Numeric#megabytes, and Numeric#gigabytes to makes things more clear. :memory_times - If :memory_max is set, :memory_times can be set to either an Integer or a 2 element Integer Array to specify the number of times the memory condition must fail. Examples: 3 (three times), [3, 5] (three out of any five checks). Default: [3, 5]. :cpu_max - The Integer CPU percentage max. Range is 0 to 100. You may use the Numberic#percent sugar to clarify e.g. 50.percent. :cpu_times - If :cpu_max is set, :cpu_times can be set to either an Integer or a 2 element Integer Array to specify the number of times the memory condition must fail. Examples: 3 (three times), [3, 5] (three out of any five checks). Default: [3, 5].
Public: Restart the process if any of the given conditions are triggered.
Yields the Metric upon which conditions can be added.
Returns nothing.
Public: Start the process if any of the given conditions are triggered.
Yields the Metric upon which conditions can be added.
Returns nothing.
Public: Stop the process if any of the given conditions are triggered.
Yields the Metric upon which conditions can be added.
Returns nothing.