vigilant v0.1.1 Vigilant

Vigilant offers tools to help monitor processes.

Link to this section Summary

Functions

Kills the calling process if fun.() does not complete within the timeout. Returns the result of calling fun.().

Monitors the process identified by pid and ensures that it does not exceed memory_limit_mb.

Monitors the process identified by pid and ensures that its message queue does not exceed message_queue_size.

Link to this section Functions

Link to this function

enforce_timeout(fun, timeout \\ 5000, after_timeout \\ fn -> nil end)
enforce_timeout(
  fun :: (() -> response :: any()),
  timeout :: integer(),
  after_timeout :: function()
) :: response :: any()

Kills the calling process if fun.() does not complete within the timeout. Returns the result of calling fun.().

Link to this function

limit_memory(pid \\ self(), memory_limit_mb)
limit_memory(pid :: pid(), memory_limit_mb :: integer()) :: :ok

Monitors the process identified by pid and ensures that it does not exceed memory_limit_mb.

Link to this function

limit_message_queue(pid \\ self(), message_queue_size)
limit_message_queue(pid :: pid(), message_queue_size :: integer()) :: :ok

Monitors the process identified by pid and ensures that its message queue does not exceed message_queue_size.