Skip to content

Commit 01b5ff8

Browse files
committed
Correct step 0 emissions measure
1 parent 2437e37 commit 01b5ff8

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

simvue/run.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -379,11 +379,16 @@ def _get_internal_metrics(
379379
step=system_metrics_step,
380380
)
381381

382-
if emission_metrics_step is not None:
382+
if (
383+
self._emissions_monitor
384+
and emission_metrics_step is not None
385+
and ems_measure_interval is not None
386+
and _current_system_measure.cpu_percent is not None
387+
):
383388
self._emissions_monitor.estimate_co2_emissions(
384389
process_id=f"{self._name}",
385390
cpu_percent=_current_system_measure.cpu_percent,
386-
measure_interval=self._system_metrics_interval,
391+
measure_interval=ems_measure_interval,
387392
gpu_percent=_current_system_measure.gpu_percent,
388393
)
389394
self._add_metrics_to_dispatch(

0 commit comments

Comments
 (0)