Bases: object
Abstract recorder class.
A recorder is reposnible for storing the record data that are provided by the monitor or profiler. The records are expected to be nametuple-like classes.
Bases: pikos.recorders.abstract_recorder.AbstractRecorder
The CSV Recorder is a simple text based recorder that records the tuple of values using a scv writer.
Private
Used to check if the set record should be recorded. The function accepts a tuple of the record values and return True is the input sould be recored.
The writer object is owned by the CSVRecorder and exports the record values according to the configured dialect.
Singify that the Recorder is ready to accept data.
Class initialization.
Parameters: |
|
---|
Bases: pikos.recorders.abstract_recorder.AbstractRecorder
The ListRecorder is simple recorder that records the tuple of values in memory as a list.
Public
List of records. The Recorder assumes that the record method is provided with a tuple and accumulates all the records in a list.
Private
Used to check if the data entry should be recorded. The function accepts a namedtuple record and return True is the input sould be recored.
Class initialization.
Parameters: | filter (callable) – A callable function to filter out the data entries that are going to be recorded. |
---|
Bases: pikos.recorders.abstract_recorder.AbstractRecorder
The TextStreamRecorder is simple recorder that formats and writes the records directly to a stream.
Private
A text stream what supports the TextIOBase interface. The Recorder will write the values as a single line.
Used to check if the set record should be recorded. The function accepts a tuple of the record values and return True is the input should be recorded.
A string (using the Format Specification Mini-Language) to format the set of values in a line. It is constructed when the prepare method is called.
A bool to enable/disable automatic flushing of the string after each record process.
Signify that the Recorder is ready to accept data.
Class initialization.
Parameters: |
|
---|
Prepare the recorder to accept data.
Parameters: | data (NamedTuple) – An example data record to prepare the recorder and write the header to the stream |
---|
Finalize the recorder
A do nothing method.
Raises : | RecorderError – Raised if the method is called without the recorder been ready to accept data. |
---|
Rerord the data entry when the filter function returns True.
Parameters: | data (NamedTuple) – The record entry. |
---|---|
Raises : | RecorderError – Raised if the method is called without the recorder been ready to accept data. |
Note
Given the value of _auto_flush the recorder will flush the stream buffers after each record.
Bases: pikos.recorders.abstract_recorder.AbstractRecorder
The ZeroMQ Recorder is a recorder that publishes each set of values on a 0MQ publish socket.
Private
Used to check if the set record should be recored. The function accepts a tuple of the record values and return True is the input sould be recored.
Singify that the Recorder is ready to accept data. Please use the Recorder.ready property