Skip to content

CPU percentage usage per process #141

@STandon-3

Description

@STandon-3

Problem

I'd like Scaphandre to be able to export a metric for the CPU percentage usage for every process, and not just the Scaphandre process.
In particular, I'm trying to get the CPU percentage usage for each virtual machine running on a server.

Solution

I can see that there is a get_process_cpu_consumption_percentage function to calculate this in the code, which I believe is used to provide the scaph_self_cpu_usage_percent metric (the CPU usage of the Scaphandre process itself).
Could this same function be used to calculate metrics for other processes and exposed in the exporters?

Alternatives

I'm aware that this could also possibly be calculated using the stats from node_exporter or with the libvirtd exporter for virtual machines in particular, but it would be good to use Scaphandre so that the CPU usage calculation was the same as that used for the scaph_process_power_consumption_microwatts.
Alternatively, it's probably possible to reverse engineer using scaph_process_power_consumption_microwatts and scaph_host_power_microwatts, although a little inconvenient!

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    Status

    Previous releases

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions