/usr/lib/python2.7/dist-packages/carbon/pipeline.py is in graphite-carbon 1.0.2-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | from carbon.util import PluginRegistrar
from carbon import state, log
class Processor(object):
__metaclass__ = PluginRegistrar
plugins = {}
NO_OUTPUT = ()
def pipeline_ready(self):
"override me if you want"
def process(self, metric, datapoint):
raise NotImplemented()
def run_pipeline_generated(metric, datapoint):
# For generated points, use a special pipeline to avoid points
# infinitely being trapped.
run_pipeline(metric, datapoint, state.pipeline_processors_generated)
def run_pipeline(metric, datapoint, processors=None):
if processors is None:
processors = state.pipeline_processors
elif not processors:
return
processor = processors[0]
try:
for out_metric, out_datapoint in processor.process(metric, datapoint):
try:
run_pipeline(out_metric, out_datapoint, processors[1:])
except Exception:
log.err()
except Exception:
log.err()
|