Skip to content

Commit

Permalink
updated run_id and added timestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
dvarelas committed Sep 24, 2023
1 parent b5d8836 commit 9e60d36
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cortisol/cortisollib/hooks.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import csv
import uuid
from time import time
from prettytable import PrettyTable

Expand Down Expand Up @@ -145,8 +146,10 @@ def on_quit(environment, **kwargs):
print(table)
if obs_stats["stats_file"]:
with open(obs_stats["stats_file"], "w") as f:
header = ["run_id", "n_requests"] + list(obs_stats["logs"].keys())
values = [f"cortisol_{int(time())}", obs_stats["n_requests"]] + list(
header = ["run_id", "timestamp", "n_requests"] + list(
obs_stats["logs"].keys()
)
values = [uuid.uuid1(), int(time()), obs_stats["n_requests"]] + list(
obs_stats["logs"].values()
)
w = csv.writer(f, delimiter=",")
Expand Down

0 comments on commit 9e60d36

Please sign in to comment.