From ee4ac4f670875e01ec17dcf497b72a56a71733bf Mon Sep 17 00:00:00 2001 From: Vincent Verelst Date: Mon, 22 Jul 2024 15:07:39 +0200 Subject: [PATCH 1/3] added cpu, memory and duration to job tracker --- src/openeo_gfmap/manager/job_manager.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/openeo_gfmap/manager/job_manager.py b/src/openeo_gfmap/manager/job_manager.py index b5c20d8..30ce8ae 100644 --- a/src/openeo_gfmap/manager/job_manager.py +++ b/src/openeo_gfmap/manager/job_manager.py @@ -211,6 +211,9 @@ def _update_statuses(self, df: pd.DataFrame): future.add_done_callback(partial(done_callback, df=df, idx=idx)) self._futures.append(future) df.loc[idx, "costs"] = job_metadata["costs"] + df.loc[idx, "memory"] = job_metadata['usage'].get('max_executor_memory', {}).get('value', None) + df.loc[idx, "cpu"] = job_metadata['usage'].get('cpu', {}).get('value', None) + df.loc[idx, "duration"] = job_metadata['usage'].get('duration', {}).get('value', None) # Case in which it failed if (df.loc[idx, "status"] != "error") and ( From 6420db649693338973e4254036dde3d107e3e691 Mon Sep 17 00:00:00 2001 From: Vincent Verelst Date: Mon, 22 Jul 2024 15:09:34 +0200 Subject: [PATCH 2/3] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4477c64..b608b6d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Added support for `FetchType.POINT` in Sentinel-1 orbit state selection +- Added CPU, max-executor-memory and duration metadata in job tracker ### Changed ### Removed From 95732965fa16528f4517c211bec677ad66868ac2 Mon Sep 17 00:00:00 2001 From: Vincent Verelst Date: Mon, 22 Jul 2024 15:10:53 +0200 Subject: [PATCH 3/3] formatting --- src/openeo_gfmap/manager/job_manager.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/openeo_gfmap/manager/job_manager.py b/src/openeo_gfmap/manager/job_manager.py index 30ce8ae..9a9f7b2 100644 --- a/src/openeo_gfmap/manager/job_manager.py +++ b/src/openeo_gfmap/manager/job_manager.py @@ -211,9 +211,17 @@ def _update_statuses(self, df: pd.DataFrame): future.add_done_callback(partial(done_callback, df=df, idx=idx)) self._futures.append(future) df.loc[idx, "costs"] = job_metadata["costs"] - df.loc[idx, "memory"] = job_metadata['usage'].get('max_executor_memory', {}).get('value', None) - df.loc[idx, "cpu"] = job_metadata['usage'].get('cpu', {}).get('value', None) - df.loc[idx, "duration"] = job_metadata['usage'].get('duration', {}).get('value', None) + df.loc[idx, "memory"] = ( + job_metadata["usage"] + .get("max_executor_memory", {}) + .get("value", None) + ) + df.loc[idx, "cpu"] = ( + job_metadata["usage"].get("cpu", {}).get("value", None) + ) + df.loc[idx, "duration"] = ( + job_metadata["usage"].get("duration", {}).get("value", None) + ) # Case in which it failed if (df.loc[idx, "status"] != "error") and (