<p>im confuse to convert nanocore to core of CPU
my formula is:</p>
<p><code>nanocore / 1000000000 = CORE (1000000000 is 1 billion)</code></p>
<p>if my linux os have 10 core.
I want to calculator percentage cpu usage. This formula is:</p>
<p><code>(nanocore / 1000000000) / 10 * 100 = percentage cpu usage ?</code></p>
<p>is it right ?</p>

<p>Yes, a core is equal to 1e9 (1,000,000,000) nanocores.</p>
<p>You can test this by seeing that, for example in Datadog, a metric like <code>(kubernetes.cpu.usage.total / 1000000000) / kubernetes_state.node.cpu_allocatable * 100</code> gives you a percentage that should be capped at 100%. The 1st metric is measured in nanocores, and the 2nd is measured in cores (<a href="https://docs.datadoghq.com/containers/kubernetes/data_collected/" rel="nofollow noreferrer">see definition here</a>).</p>
<p>Here's another answer that aligns with this: <a href="https://discuss.kubernetes.io/t/metric-server-cpu-and-memory-units/7497/2" rel="nofollow noreferrer">link</a></p>
