<p>I'm querying the Kubernetes kubelet API (curl -s <a href="http://localhost:10255/stats/summary" rel="nofollow">http://localhost:10255/stats/summary</a>) for CPU/Memory statistics and the CPU info is showing up as follows.</p>

<pre><code>        "cpu": {
            "time": "2016-08-04T22:48:22Z",
            "usageNanoCores": 6392499,
            "usageCoreNanoSeconds": 3270519504746
        },
</code></pre>

<p>How do I convert usageNanoCores or usageCoreNanoSeconds to CPU utilization percentage? </p>

<blockquote>
  <p>If a process were to run on one cpu continuously for a second, its
  usage will be 1e+9 nanoseconds. If it ran on <code>n</code> cores continuously
  its usage will n * 1e+9 nanoseconds. </p>
  
  <p>Percentage will be usage_in_nanoseconds / (capacity_in_absolute_cores
  * 1e+9).</p>
</blockquote>

<p>*source: <a href="https://github.com/kubernetes/heapster/issues/650#issuecomment-147795824" rel="nofollow">https://github.com/kubernetes/heapster/issues/650#issuecomment-147795824</a></p>
