diff options
author | Dimitri Staessens <dimitri@ouroboros.rocks> | 2021-07-11 15:00:43 +0200 |
---|---|---|
committer | Dimitri Staessens <dimitri@ouroboros.rocks> | 2021-07-11 15:00:43 +0200 |
commit | 1cdec2d22d5bb35f6f7c170d7231673924b01b2b (patch) | |
tree | 0e1ff1c333f96b4c42e808354e948068cfe111a5 | |
parent | f206320c33197da4d4a4af8ac98aa1f3bff3e5cc (diff) | |
download | ouroboros-metrics-1cdec2d22d5bb35f6f7c170d7231673924b01b2b.tar.gz ouroboros-metrics-1cdec2d22d5bb35f6f7c170d7231673924b01b2b.zip |
pyExporter: Make interval configurable
The metrics interval can now be set in millisecond increments from
commandline using -i <interval> or --i <interval>. Default is 1000 (1
second).
-rwxr-xr-x | exporters-influxdb/pyExporter/oexport.py | 9 |
1 files changed, 7 insertions, 2 deletions
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) |