Skip to content

Commit

Permalink
record elapsed time in stats
Browse files Browse the repository at this point in the history
  • Loading branch information
wumpus committed Feb 6, 2022
1 parent 7a35321 commit 7925530
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions eht_met_forecast/cli.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import sys
import time
import datetime
import os
from argparse import ArgumentParser
Expand Down Expand Up @@ -90,6 +91,7 @@ def main(args=None):
stats = defaultdict(int)
stats['stations'] = []
stats['gfs_time'] = cycles[0].strftime(GFS_TIMESTAMP)
t0 = time.time()

for vex in stations:
station = station_dict[vex]
Expand Down Expand Up @@ -127,6 +129,11 @@ def main(args=None):
f.close()

stats['stations'] = ':'.join(sorted(stats['stations']))
elapsed = int(time.time() - t0)
if args.wait:
stats['elapsed_wait_s'] = elapsed
else:
stats['elapsed_s'] = elapsed
dump_stats(stats, log=args.log)
dump_latency_histograms(log=args.log)

Expand Down

0 comments on commit 7925530

Please sign in to comment.