Yeah, that initial expression gives you the CPU usage in percent of a CPU
core (not seconds or MHz). So if you have 1 core and it's 100% used, you
will get an output value of 100, for 2 fully used cores you would get 200,
etc.

It doesn't seem like cAdvisor exposes any clock speed (MHz) metrics, see
also https://github.com/google/cadvisor/issues/2354. Though the Node
Exporter does (see
https://www.robustperception.io/cpu-frequency-scaling-metrics-from-the-node-exporter),
but how much sense it makes to combine that with the container-level CPU
usage data, I'm not sure.

On Thu, Apr 1, 2021 at 3:56 PM Ben Kochie <[email protected]> wrote:

> CPU use is never measured in "Mhz". Linux, and hence containers, only
> record CPU use in "CPU Seconds", the frequency of the clock is not part of
> the data.
>
> On Thu, Apr 1, 2021 at 3:11 PM Bill Zalokostas <[email protected]>
> wrote:
>
>> The type sum by(image)
>> (rate(container_cpu_usage_seconds_total{image="my-image-name"}[5m])) * 100
>> is returning seconds or Mhz? I want to get this CPU usage metric from
>> prometheus and use custom metric in my autoscaler in order to deploy or
>> delete replicas in the slave-node, so I have to Mhz. Is there any solution
>> here?
>>
>> Thank you in advance
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Prometheus Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/prometheus-users/fb237952-2939-49a5-bf88-f04de9eef4b6n%40googlegroups.com
>> <https://groups.google.com/d/msgid/prometheus-users/fb237952-2939-49a5-bf88-f04de9eef4b6n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Prometheus Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/prometheus-users/CABbyFmrhB5SvAtEwAmaX_yWM3cf3Fo-gj09xnDGofGP84o4OMg%40mail.gmail.com
> <https://groups.google.com/d/msgid/prometheus-users/CABbyFmrhB5SvAtEwAmaX_yWM3cf3Fo-gj09xnDGofGP84o4OMg%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>


-- 
Julius Volz
PromLabs - promlabs.com

-- 
You received this message because you are subscribed to the Google Groups 
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/CAObpH5w65uaExbv-nD%2BhVSd%3DXvtdZt%2BZ0H6xjwqhAVEySZFR_Q%40mail.gmail.com.

Reply via email to