mentat.daemon.component.sampler module

Daemon component providing message sampling functions based on configurable keys.

The implementation is based on pyzenkit.zendaemon.ZenDaemonComponent.

class mentat.daemon.component.sampler.SamplerDaemonComponent(**kwargs)[source]

Bases: ZenDaemonComponent

Implementation of ZenDaemonComponent providing message sampling functions.

CONFIG_SAMPLING_KEYS = 'sampling_keys'
CONFIG_SAMPLING_LIMIT = 'sampling_limit'
CONFIG_SAMPLING_POLICY = 'sampling_policy'
EVENT_LOG_STATISTICS = 'log_statistics'
EVENT_MSG_PROCESS = 'message_process'
STATS_CNT_ERRORS = 'cnt_errors'
STATS_CNT_SAMPLED = 'cnt_sampled'
STATS_CNT_STOPPED = 'cnt_stopped'
cbk_event_log_statistics(daemon, args)[source]

Periodical processing statistics logging.

cbk_event_message_process(daemon, args)[source]

Print the message contents into the log.

cbk_sample_keyed(daemon, args)[source]

Sampling algorithm - keyed counting.

cbk_sample_simple(daemon, args)[source]

Simple sampling algorithm.

get_events()[source]

Get the list of event names and their appropriate callback handlers.

setup(daemon)[source]

Perform component setup.