Skip to content

Commit

Permalink
Merge pull request #636 from facebookresearch/record-static-agent-sta…
Browse files Browse the repository at this point in the history
…te-times

Record StaticAgentState task start and end
  • Loading branch information
EricMichaelSmith committed Jan 5, 2022
2 parents 4629f26 + 490bdf9 commit 82b22c7
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,3 +114,15 @@ def update_data(self, packet: "Packet") -> None:
outputs["files"] = [f["filename"] for f in packet.data["files"]]
self.state["outputs"] = outputs
self.save_data()

def get_task_start(self) -> Optional[float]:
"""
Extract out and return the start time recorded for this task.
"""
return self.state["times"]["task_start"]

def get_task_end(self) -> Optional[float]:
"""
Extract out and return the end time recorded for this task.
"""
return self.state["times"]["task_end"]

0 comments on commit 82b22c7

Please sign in to comment.