| |
- builtins.object
-
- HealthState
- plugins.base_plugin.MaukaPlugin(builtins.object)
-
- StatusPlugin
class HealthState(builtins.object) |
|
Thread safe class for passing plugin state to HTTP server |
|
Methods defined here:
- __init__(self)
- Initialize self. See help(type(self)) for accurate signature.
- as_json(self) -> bytes
- :return: Thread safe method that returns the current state as encoded bytes.
- set_key(self, key, value)
- Thread safe message for setting a key-pair value within this class.
:param key: The key to set.
:param value: The value to set.
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
|
class StatusPlugin(plugins.base_plugin.MaukaPlugin) |
|
StatusPlugin(conf: config.MaukaConfig, exit_event: <bound method BaseContext.Event of <multiprocessing.context.DefaultContext object at 0x1024ecb00>>)
This module contains a plugin that reports and records the status of other plugins in the system |
|
- Method resolution order:
- StatusPlugin
- plugins.base_plugin.MaukaPlugin
- builtins.object
Methods defined here:
- __init__(self, conf: config.MaukaConfig, exit_event: <bound method BaseContext.Event of <multiprocessing.context.DefaultContext object at 0x1024ecb00>>)
- Initializes this plugin
:param conf: Configuration dictionary
- on_message(self, topic, mauka_message)
- This gets called when a subscriber receives a message from a topic they are subscribed too.
This should be implemented in all subclasses.
:param topic: The topic this message is associated with
:param mauka_message: The message contents
Data and other attributes defined here:
- NAME = 'StatusPlugin'
Methods inherited from plugins.base_plugin.MaukaPlugin:
- debug(self, msg: str)
- Prints a debug message using this classes logger and formatted the plugin name.
:param msg: Message to print to debug.
- get_mongo_client(self)
- Returns an OPQ mongo client
:return: An OPQ mongo client
- get_status(self) -> str
- Return the status of this plugin
:return: The status of this plugin
- handle_self_message(self, message: str)
- Handles a self-message
:param message: The message to handle
- is_self_message(self, topic: str) -> bool
- Determines if this is a message directed at this plugin. I.e. the topic is the name of the plugin.
:param topic: Topic of the message
:return: If this is a self message or not
- produce(self, topic: str, mauka_message: mauka_pb2.MaukaMessage)
- Produces a message with a given topic to the system
:param topic: The topic to produce this message to
:param mauka_message: The message to produce
- run_plugin(self)
- This is the run loop for this plugin process
- start_heartbeat(self)
- This is a recursive function that acts as a heartbeat.
This function calls itself over-and-over on a timer to produce heartbeat messages. The interval can be
configured is the configuration file.
Data descriptors inherited from plugins.base_plugin.MaukaPlugin:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
| |