diff --git a/pacer2influxdb.py b/pacer2influxdb.py index f2635f8..35b5b5b 100755 --- a/pacer2influxdb.py +++ b/pacer2influxdb.py @@ -20,7 +20,8 @@ def main(host='localhost', port=8086, user='root', password='root', dbname='demo ts=0 lastdate=0 - print("last entry is %s, ts is %s" % (lastdate,ts)) + if args.verbose: + print("last entry is %s, ts is %s\n" % (lastdate,ts)) con = lite.connect(dbfile) with con: @@ -46,7 +47,9 @@ def main(host='localhost', port=8086, user='root', password='root', dbname='demo } ] - #print(data) + if args.verbose: + print("writing data for %s" % (mytime)) + db.write_points(data) db.close() @@ -54,6 +57,9 @@ def parse_args(): """Parse the args from main.""" parser = argparse.ArgumentParser( description='Export Pacer data to InfluxDB') + parser.add_argument('--verbose', required=False, + action="store_true", + help='verbose output') parser.add_argument('--host', type=str, required=False, default='localhost', help='hostname of InfluxDB http API')