Skip to content

Commit

Permalink
Merge pull request #155 from hagertnl/nick-issue141
Browse files Browse the repository at this point in the history
Fix rounding issue in harness utilities
  • Loading branch information
ddietz89 authored Jan 4, 2024
2 parents 13483f0 + 5eced76 commit a143092
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 13 deletions.
10 changes: 0 additions & 10 deletions harness/libraries/a

This file was deleted.

2 changes: 1 addition & 1 deletion harness/utilities/add_comment_to_influx.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def post_update_to_influx(d):
raise ValueError(e)
# Assume it's in UTC right now, convert to EST

log_ns = int(datetime.datetime.timestamp(log_time) * 1000 * 1000) * 1000
log_ns = round(datetime.datetime.timestamp(log_time) * 1000 * 1000) * 1000

tagline = ','.join([f"{fld}={d[fld]}" for fld in tags])
fieldline = ','.join([f"{fld}=\"{d[fld]}\"" for fld in fields])
Expand Down
2 changes: 1 addition & 1 deletion harness/utilities/change_machine_in_influx.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def post_update_to_influx(d):
except ValueError as e:
raise ValueError(e)
# microsecond timing max precision
log_ns = int(datetime.datetime.timestamp(log_time) * 1000 * 1000) * 1000
log_ns = round(datetime.datetime.timestamp(log_time) * 1000 * 1000) * 1000

tagline = ','.join([f"{fld}={d[fld]}" for fld in tags])
fieldline = ','.join([f"{fld}=\"{d[fld]}\"" for fld in fields])
Expand Down
2 changes: 1 addition & 1 deletion harness/utilities/update_runs_from_slurm.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ def post_update_to_influx(d, state_code):
if not 'timestamp' in d.keys():
d['timestamp'] = datetime.datetime.now().isoformat()
log_time = datetime.strptime(d['timestamp'], "%Y-%m-%dT%H:%M:%S")
log_ns = int(datetime.timestamp(log_time) * 1000 * 1000) * 1000
log_ns = round(datetime.timestamp(log_time) * 1000 * 1000) * 1000

influx_event_record_string = f"events,{','.join([f'{t}={d[t]}' for t in StatusFile.INFLUX_TAGS])} "
quote = '"'
Expand Down

0 comments on commit a143092

Please sign in to comment.