View Source ZenMonitor.Proxy.Batcher (ZenMonitor v2.0.3)

ZenMonitor.Proxy.Batcher is responsible for collecting death_certificates from ZenMonitor.Proxy destined for the Batcher's subscriber (normally the subscriber is a ZenMonitor.Local.Connector)

Periodically it will sweep and send all of the death_certificates it has collected since the last sweep to the subscriber for processing.

Link to this section Summary

Functions

Returns a specification to start this module under a supervisor.

Gets the chunk size from the Application Environment

Puts the chunk size into the Application Environment

Enqueues a new death certificate into the batcher

Get a batcher for a given subscriber

Handle enqueuing a new death_certificate

Callback implementation for GenServer.init/1.

Gets the sweep interval from the Application Environment

Puts the sweep interval into the Application Environment

Link to this section Functions

Returns a specification to start this module under a supervisor.

See Supervisor.

Specs

chunk_size() :: integer()

Gets the chunk size from the Application Environment

The chunk size is the maximum number of death certificates that will be sent during each sweep, see ZenMonitor.Proxy.Batcher's @chunk_size for the default value

This can be controlled at boot and runtime with the {:zen_monitor, :batcher_chunk_size} setting, see ZenMonitor.Proxy.Batcher.chunk_size/1 for runtime convenience functionality.

Specs

chunk_size(value :: integer()) :: :ok

Puts the chunk size into the Application Environment

This is a simple convenience function for overwrite the {:zen_monitor, :batcher_chunk_size} setting at runtime.

Link to this function

enqueue(batcher, pid, reason)

View Source

Specs

enqueue(batcher :: pid(), pid(), reason :: any()) :: :ok

Enqueues a new death certificate into the batcher

Specs

get(subscriber :: pid()) :: pid()

Get a batcher for a given subscriber

Handle enqueuing a new death_certificate

Simply puts it in the batch queue.

Callback implementation for GenServer.init/1.

Specs

sweep_interval() :: integer()

Gets the sweep interval from the Application Environment

The sweep interval is the number of milliseconds to wait between sweeps, see ZenMonitor.Proxy.Batcher's @sweep_interval for the default value

This can be controlled at boot and runtime with the {:zen_monitor, :batcher_sweep_interval} setting, see ZenMonitor.Proxy.Batcher.sweep_interval/1 for runtime convenience functionality.

Specs

sweep_interval(value :: integer()) :: :ok

Puts the sweep interval into the Application Environment

This is a simple convenience function for overwrite the {:zen_monitor, :batcher_sweep_interval} setting at runtime