snap_plugin.v1.processor module

class snap_plugin.v1.processor.Processor(name, version, **kwargs)

Bases: snap_plugin.v1.plugin.Plugin

Abstract base class for ‘processor’ plugins.

This class makes the creation of snap ‘processor’ plugins as easy as possible. For instance, when a class inherits from snap_plugin.v1.processor.Process plugins can be created by providing implementation for:

process(metrics, config)

Process metrics.

This method is abstract so the implementation must be provided by the plugin which extends snap_plugin.v1.Processor.

This method is called by the Snap deamon during the process phase of the execution of a Snap workflow. Examples of processing metrics include applying filtering, max, min, average functions as well as adding additional context to the metrics to name just a few.

Parameters:(obj (metrics) – list of snap_plugin.v1.Metric): List of metrics to be processed.
Returns:List of processed metrics.
Return type:list of snap_plugin.v1.Metric