add verbose output
This commit is contained in:
parent
6e6a7baaca
commit
20cfcf3568
1 changed files with 8 additions and 2 deletions
|
@ -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')
|
||||
|
|
Loading…
Reference in a new issue