dragonfly.implementations.pinger module

Some template vars

Members: Pinger Functions: Classes:

Ping on a regular basis a list of endpoints

Summary

class dragonfly.implementations.pinger.Pinger(services_to_ping=[], ping_timeout=10, **kwargs)

Bases: dragonfly.implementations.pinger.Pinger

Ping on a regular basis a list of service. It sends a request to target.ping, if a response is not given within the timeout, it reports a logger.critical, which sends an alert to status_message.critical.<service_name> via the AMQPHandler. services_to_ping: list of the services to ping ping_timeout: duration before considering a ping failed

Keyword Arguments:
 
  • name (str) – unique identifier across all dripline services (used to determine routing key)
  • calibration (str||dict) – string use to process raw get result (with .format(raw)) or a dict to use for the same purpose where raw must be a key
  • get_on_set (bool) – flag to toggle running ‘on_get’ after each ‘on_set’
  • schedule_interval (float) – time in seconds between scheduled events
handle_request(channel, method, properties, request)
is_locked
lock(lockout_key=None, *args, **kwargs)
lockout_key
on_cmd(*args, **kwargs)

WARNING! if you override this method, you must ensure you deal with lockout properly

on_config(attribute, value=None)

configure a property again

WARNING! if you override this method, you must ensure you deal with lockout properly

ping(*args, **kwargs)

ignore all details and respond with an empty message

ping_status
schedule_interval
schedule_status
scheduled_action()

Override Scheduler method with Pinger-specific action

set_condition(*args, **kwargs)

To actually do something inside a class, the set_condition should be implemented in the class itself.

silence_ping(service, endtime)
single_schedule(delay)
unlock(*args, **kwargs)

End of modules condition

Data:

End of data condition