Skip to content

Conversation

@Matyro
Copy link
Contributor

@Matyro Matyro commented Jan 12, 2026

Description

This is the followup of !984

Added the functionality to track several process ids and its children
This was implemented by isolating CPU relevant parts from external/hardware into cpu/hardware and modifying the energy and power functions to scale there return value with CPU Utilization.

Related Issue

Motivation and Context

This enables emission data logging of other processes. In my case its the automatic tracking and reporting of energy consumption to users in a slurm cluster environment.

Currently if given pids are childs of each other statistics will be double counted

How Has This Been Tested?

Changes will be texted on a testcluster

Types of changes

What types of changes does your code introduce? Put an x in all the boxes that apply:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

Go over all the following points, and put an x in all the boxes that apply.

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING.md document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@Matyro Matyro requested a review from a team as a code owner January 12, 2026 11:56
@Matyro Matyro mentioned this pull request Jan 12, 2026
9 tasks
@Matyro
Copy link
Contributor Author

Matyro commented Jan 12, 2026

self._cpu_utilization_history.append(psutil.cpu_percent())
self._ram_utilization_history.append(psutil.virtual_memory().percent)
self._ram_used_history.append(psutil.virtual_memory().used / (1024**3))

Should this be always machine metrics or depending on tracking mode?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants