Skip to content

Commit

Permalink
updating the service to operate in US instead of S time unit
Browse files Browse the repository at this point in the history
  • Loading branch information
Dhruv Garg committed Nov 27, 2024
1 parent 15bf380 commit 0b3a661
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions rpc/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ async def RegisterFramework(self, request, context):
t = int(time.time())
framework_name = request.name
self._master_uri = request.uri
self._initialization_time = EventTime(t, EventTime.Unit.S)
self._initialization_time = EventTime(t, EventTime.Unit.US)
stime = self.__stime()

parsed_uri = urlparse(self._master_uri)
Expand Down Expand Up @@ -398,7 +398,7 @@ async def RegisterTaskGraph(self, request, context):
dependencies=dependencies,
dataset_size=dataset_size,
max_executors_per_job=max_executors_per_job,
runtime_unit=EventTime.Unit.S,
runtime_unit=EventTime.Unit.US,
)
except Exception as e:
msg = f"[{stime}] Failed to load TPCH query {query_num}. Exception: {e}"
Expand Down Expand Up @@ -692,7 +692,9 @@ def __stime(self) -> EventTime:
if self._initialization_time is None:
return EventTime.invalid()
ts = int(time.time())
ts = EventTime(ts, EventTime.Unit.S)
# NOTE: The service runs in the US time unit for better compatibility with the simulator.
# The simulator uses an abstract unit of time, and it is all relative.
ts = EventTime(ts, EventTime.Unit.US)
return ts - self._initialization_time

def __framework_registered(self):
Expand Down

0 comments on commit 0b3a661

Please sign in to comment.