pypond.processor package

Submodules

pypond.processor.aggregator module

Processor that adds events to collector given windowing and grouping options.

class pypond.processor.aggregator.Aggregator(arg1, options=<pypond.util.Options object>)

Bases: pypond.processor.base.Processor

An Aggregator takes incoming events and adds them to a Collector with given windowing and grouping parameters. As each Collection is emitted from the Collector it is aggregated into a new event and emitted from this Processor.

Parameters:
  • arg1 (Aggregator or Pipeline) – Copy constructor or the pipeline.
  • options (Options) – Options object.
add_event(event)

Add an event to the collector.

Parameters:event (Event) – An event object
clone()

clone it.

flush()

flush.

pypond.processor.align module

Simple processor to change the event values by a certain offset.

Primarily for testing.

class pypond.processor.align.Align(arg1, options=<pypond.util.Options object>)

Bases: pypond.processor.base.Processor

A processor to align the data into bins of regular time period.

Parameters:
  • arg1 (Align or Pipeline) – Pipeline or copy constructor
  • options (Options, optional) – Pipeline Options object.
Raises:

ProcessorException – Raised on bad arg types.

add_event(event)

Output an even that is Align by a certain value.

Parameters:event (Event) – An Event.
clone()

Clone this Align processor.

Returns:Cloned Align object.
Return type:Align

pypond.processor.base module

Base class for all processors.

class pypond.processor.base.Processor(arg1, options)

Bases: pypond.bases.Observable

Base class for all pipeline processors.

chain()

Return the chain

pipeline()

Return the pipeline

prev()

Return prev

pypond.processor.base.add_prev_to_chain(n, chain)

Recursive function to add values to the chain.

pypond.processor.collapser module

Collapse the columns and return a new event

class pypond.processor.collapser.Collapser(arg1, options=<pypond.util.Options object>)

Bases: pypond.processor.base.Processor

A processor which takes a fieldSpec and returns a new event with a new column that is a collapsed result of the selected columns. To collapse the columns it uses the supplied reducer function. Optionally the new column can completely replace the existing columns in the event.

Parameters:
  • arg1 (Collapser or Pipeline) – Copy constructor or the pipeline.
  • options (Options) – Options object.
add_event(event)

Perform the collapse operation on the event and emit.

Parameters:event (Event, IndexedEvent, TimerangeEvent) – Any of the three event variants.
clone()

clone it.

pypond.processor.converter module

Convert an event into another event type.

class pypond.processor.converter.Converter(arg1, options=<pypond.util.Options object>)

Bases: pypond.processor.base.Processor

A processor that converts an event type to another event type.

Parameters:
  • arg1 (Converter or Pipeline) – Copy constructor or the pipeline.
  • options (Options) – Options object.
add_event(event)

Perform the conversion on the event and emit.

Parameters:event (Event, IndexedEvent, TimerangeEvent) – Any of the three event variants.
clone()

clone it.

convert_event(event)

Convert an Event

Parameters:event (Event) – An incoming Event object for conversion.
Returns:The converted Event.
Return type:TimeRangeEvent or IndexedEvent
convert_indexed_event(event)

Convert an IndexedEvent

Parameters:event (IndexedEvent) – An incoming IndexedEvent object for conversion.
Returns:The converted IndexedEvent.
Return type:TimeRangeEvent or Event
convert_time_range_event(event)

Convert a TimeRangeEvent

Parameters:event (TimeRangeEvent) – An incoming TimeRangeEvent object for conversion.
Returns:The converted TimeRangeEvent. Can not convert to IndexedEvent.
Return type:Event

pypond.processor.filler module

A processor to fill missing and invalid values.

class pypond.processor.filler.Filler(arg1, options=<pypond.util.Options object>)

Bases: pypond.processor.base.Processor

A processor that fills missing/invalid values in the event with new values (zero, interpolated or padded).

When doing a linear fill, Filler instances should be chained. See the Fill/sanitize doc (sanitize.md) for details.

If no field_spec is supplied, the default field ‘value’ will be used.

Parameters:
  • arg1 (Filler or Pipeline) – Copy constructor or the pipeline.
  • options (Options) – Options object.
add_event(event)

Perform the fill operation on the event and emit.

Parameters:event (Event, IndexedEvent, TimerangeEvent) – Any of the three event variants.
clone()

clone it.

flush()

Don’t delegate flush to superclass yet. Make sure there are no cached events (could happen if we stop seeing valid events) before passing it up the food chain.

pypond.processor.filter module

Processor that takes an operator to control event flow.

class pypond.processor.filter.Filter(arg1, options=<pypond.util.Options object>)

Bases: pypond.processor.base.Processor

A processor which takes an operator as its only option and uses that to either output a new event.

Parameters:
  • arg1 (Filter or Pipeline) – Copy constructor or the pipeline.
  • options (Options) – Options object.
add_event(event)

Perform the filter operation on the event and emit.

Parameters:event (Event, IndexedEvent, TimerangeEvent) – Any of the three event variants.
clone()

clone it.

pypond.processor.mapper module

Take and operator and perform map operations

class pypond.processor.mapper.Mapper(arg1, options=<pypond.util.Options object>)

Bases: pypond.processor.base.Processor

A processor which takes an operator as its only option and uses that to either output a new event.

Parameters:
  • arg1 (Mapper or Pipeline) – Copy constructor or the pipeline.
  • options (Options) – Options object.
add_event(event)

Perform the map operation on the event and emit.

Parameters:event (Event, IndexedEvent, TimerangeEvent) – Any of the three event variants.
clone()

clone it.

pypond.processor.offset module

Simple processor to change the event values by a certain offset.

Primarily for testing.

class pypond.processor.offset.Offset(arg1, options=<pypond.util.Options object>)

Bases: pypond.processor.base.Processor

A simple processor used by the testing code to verify Pipeline behavior.

Parameters:
  • arg1 (Offset or Pipeline) – Pipeline or copy constructor
  • options (Options, optional) – Pipeline Options object.
Raises:

ProcessorException – Raised on bad arg types.

add_event(event)

Output an even that is offset by a certain value.

Parameters:event (Event, IndexedEvent, TimerangeEvent) – Any of the three event variants.
clone()

Clone this Offset processor.

Returns:Cloned offset object.
Return type:Offset

pypond.processor.rate module

Simple processor generate the Rate of two Event objects and emit them as a TimeRangeEvent. Can be used alone or chained with the Align processor for snmp rates, etc.

class pypond.processor.rate.Rate(arg1, options=<pypond.util.Options object>)

Bases: pypond.processor.base.Processor

Generate rate from two events.

Parameters:
  • arg1 (Rate or Pipeline) – Pipeline or copy constructor
  • options (Options, optional) – Pipeline Options object.
Raises:

ProcessorException – Raised on bad arg types.

add_event(event)

Output an even that is Rate by a certain value.

Parameters:event (Event) – An Event.
clone()

Clone this Rate processor.

Returns:Cloned Rate object.
Return type:Rate

pypond.processor.selector module

Processor to return events with only selected columns

class pypond.processor.selector.Selector(arg1, options=<pypond.util.Options object>)

Bases: pypond.processor.base.Processor

A processor which takes a fieldSpec as its only argument and returns a new event with only the selected columns

Parameters:
  • arg1 (Selector or Pipeline) – Copy constructor or the pipeline.
  • options (Options) – Options object.
add_event(event)

Perform the select operation on the event and emit.

Parameters:event (Event, IndexedEvent, TimerangeEvent) – Any of the three event variants.
clone()

clone it.

pypond.processor.taker module

Processor that limits the number of events that are processed.

class pypond.processor.taker.Taker(arg1, options=<pypond.util.Options object>)

Bases: pypond.processor.base.Processor

A processor which limits the number of events that are processed.

Parameters:
  • arg1 (Taker or Pipeline) – Copy constructor or the pipeline.
  • options (Options) – Options object.
add_event(event)

Output an event that is offset.

Parameters:event (Event, IndexedEvent, TimerangeEvent) – Any of the three event variants.
clone()

clone it.

flush()

Module contents

Unify the processor classes from the individual modules so one can:

from pypond.processor import Mapper