plugin: format docstring as rst
Change-Id: I14de69e743aece44b496aa62e89a8066b1fdde67 Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
@@ -56,11 +56,16 @@ class NotificationBase(PluginBase):
|
||||
@abc.abstractmethod
|
||||
def get_exchange_topics(self, conf):
|
||||
"""Return a sequence of ExchangeTopics defining the exchange and
|
||||
topics to be connected for this plugin."""
|
||||
topics to be connected for this plugin.
|
||||
|
||||
:param conf: Configuration.
|
||||
"""
|
||||
|
||||
@abc.abstractmethod
|
||||
def process_notification(self, message):
|
||||
"""Return a sequence of Counter instances for the given message."""
|
||||
"""Return a sequence of Counter instances for the given message.
|
||||
|
||||
:param message: Message to process."""
|
||||
|
||||
def notification_to_metadata(self, event):
|
||||
"""Transform a payload dict to a metadata dict."""
|
||||
@@ -94,7 +99,7 @@ class PublisherBase(PluginBase):
|
||||
|
||||
@abc.abstractmethod
|
||||
def publish_counters(self, context, counters, source):
|
||||
"Publish counters into final conduit"
|
||||
"Publish counters into final conduit."
|
||||
|
||||
|
||||
class TransformerBase(PluginBase):
|
||||
@@ -104,29 +109,28 @@ class TransformerBase(PluginBase):
|
||||
|
||||
@abc.abstractmethod
|
||||
def handle_sample(self, context, counter, source):
|
||||
"""Transform a counter
|
||||
|
||||
parameter:
|
||||
context: Passed from the data collector
|
||||
counters: An interator of counters.
|
||||
source: Passed from data collector.
|
||||
"""Transform a counter.
|
||||
|
||||
:param context: Passed from the data collector.
|
||||
:param counter: A counter.
|
||||
:param source: Passed from data collector.
|
||||
"""
|
||||
|
||||
def flush(self, context, source):
|
||||
"""Flush counters cached previously"""
|
||||
"""Flush counters cached previously.
|
||||
|
||||
:param context: Passed from the data collector.
|
||||
:param source: Source of counters that are being published."""
|
||||
return []
|
||||
|
||||
def __init__(self, **parameter):
|
||||
"""Setup transformer
|
||||
def __init__(self, **kwargs):
|
||||
"""Setup transformer.
|
||||
|
||||
Each time a transformed is involved in a pipeline, a new transformer
|
||||
instance is created and chained into the pipeline. i.e. transformer
|
||||
instance is per pipeline. This helps if transformer need keep some
|
||||
cache and per-pipeline information.
|
||||
|
||||
parameter:
|
||||
kwds: the parameter that is defined in pipeline config file
|
||||
|
||||
:param kwargs: The parameters that are defined in pipeline config file.
|
||||
"""
|
||||
super(TransformerBase, self).__init__()
|
||||
|
Reference in New Issue
Block a user