Skip to content
Snippets Groups Projects
Commit ba186562 authored by Christopher Randolph Rhodes's avatar Christopher Randolph Rhodes
Browse files

Improved resolution of step timing

parent b9f27095
No related branches found
No related tags found
No related merge requests found
......@@ -2,7 +2,7 @@
Implementation of image analysis work behind API endpoints, without knowledge of persistent data in server session.
"""
from time import sleep, time
from time import perf_counter
from typing import Dict
from model_server.image import generate_file_accessor, write_accessor_data_to_file
......@@ -10,13 +10,15 @@ from model_server.image import generate_file_accessor, write_accessor_data_to_fi
from pydantic import BaseModel
class Timer(object):
tfunc = perf_counter
def __init__(self):
self.events = {}
self.last = time()
self.last = self.tfunc()
def click(self, key):
self.events[key] = time() - self.last
self.last = time()
self.events[key] = self.tfunc() - self.last
self.last = self.tfunc()
class WorkflowRunRecord(BaseModel):
model_id: str
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment