diff --git a/src/job_insights/adapters/status_client.py b/src/job_insights/adapters/status_client.py index a09bc5d5c399a7c894caceb2222d2359df536682..857d0f9de12092f3b19f68ebccbdebc749c4ce9e 100644 --- a/src/job_insights/adapters/status_client.py +++ b/src/job_insights/adapters/status_client.py @@ -12,5 +12,8 @@ class StatusClient: self._tool = tool def fetch(self, *, job_id: str, job_name: str) -> dict[str, object]: - del job_id - return self._tool.get_job_status(job_name=job_name) + del job_name + status = self._tool.get_job_status(job_id=job_id) + return { + "duration_milliseconds": status["duration_milliseconds"], + } diff --git a/src/job_insights/services/summary.py b/src/job_insights/services/summary.py index dca5e28644e9dc71746152dda27362de436c37db..7224de799c47fbc1e6f17e58f8f7288e9ba8ca2c 100644 --- a/src/job_insights/services/summary.py +++ b/src/job_insights/services/summary.py @@ -10,7 +10,7 @@ def build_job_insight( tool: JobStatusTool, ) -> str: status = StatusClient(tool).fetch(job_id=job_id, job_name=job_name) - duration = float(status["duration_seconds"]) + duration = int(status["duration_milliseconds"]) / 1000 return f"Job insight for {job_name}: {duration:g} seconds"