Skip to main content

Metrics exporter.

Project description

metrics_exporter

How to use

Set the metrics names and the postgres connection:

me = MetricsExporter(
    metricsGroups=[['metric1', 'metric2'], ['metric3']],
    tableName='it',
    user='root',
    password='root',
    dbname='postgres',
    host='localhost',
    port=5432,
    bufferSize=10000
)

For each metrics, 3 other metrics will be calculated:

  • Nomamlized value over the metric group
  • Accumulated value of the metric
  • Normalized accumulated value over the metric group

Now you can insert a new metric for a month in a page/user:

me.insertMetric(
    1, 'pippo', '201005',
    [{
        'metric1': 2,
        'metric2': 4
    }, {
        'metric3': 2
    }]
)

To be sure that all metrics have been saved to the database in the end run:

me.finalize()

Pip package

To update the pip package

python setup.py sdist
twine upload dist/*

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

metrics_exporter-0.0.2.tar.gz (3.2 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page