p3exporter.collector package

Entry point for collector sub module.

class p3exporter.collector.Collector(config: p3exporter.collector.CollectorConfig)[source]

Bases: object

Base class to load collectors.

All collectors have to be placed inside the directory collector. You have to follow the naming convention:

  1. Place the collector code in a <name>.py file (e.g. my.py)

  2. Within the file <name>.py` a class <Name>Collector (e.g. MyController) needs to be defined. This is the main collector class which will be imported, instantiate and registered automatically.

class p3exporter.collector.CollectorConfig(**kwargs)[source]

Bases: object

Class that provide all the logic needed for configuration handling.

Submodules

p3exporter.collector.loadavg module

class p3exporter.collector.loadavg.LoadavgCollector(config: p3exporter.collector.CollectorConfig)[source]

Bases: object

collect()[source]

Collect load avg for 1, 5 and 15 minutes interval.

Returns three gauge metrics. One for each load.

p3exporter.collector.my module

class p3exporter.collector.my.MyCollector(config: p3exporter.collector.CollectorConfig)[source]

Bases: object

A sample collector.

It does not really do much. It only runs a method and return the time it runs as a gauge metric.

collect()[source]

Collect the metrics.