From 1cdec2d22d5bb35f6f7c170d7231673924b01b2b Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Sun, 11 Jul 2021 15:00:43 +0200 Subject: pyExporter: Make interval configurable The metrics interval can now be set in millisecond increments from commandline using -i or --i . Default is 1000 (1 second). --- exporters-influxdb/pyExporter/oexport.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'exporters-influxdb/pyExporter') diff --git a/exporters-influxdb/pyExporter/oexport.py b/exporters-influxdb/pyExporter/oexport.py index 0df3bb1..3b0f324 100755 --- a/exporters-influxdb/pyExporter/oexport.py +++ b/exporters-influxdb/pyExporter/oexport.py @@ -36,6 +36,7 @@ import os import re import socket import time +import argparse from datetime import datetime from typing import Optional @@ -886,6 +887,10 @@ class OuroborosExporter: if __name__ == '__main__': - + argparser = argparse.ArgumentParser(description="Ouroboros InfluxDB metrics exporter") + argparser.add_argument('-i', '--interval', type=int, default='1000', + help="Interval at which to collect metrics (milliseconds)") + args = argparser.parse_args() + interval_ms = args.interval exporter = OuroborosExporter() - exporter.run(interval_ms=1000) + exporter.run(interval_ms=interval_ms) -- cgit v1.2.3