<p>I want to calculate and show node specific cpu usage in percent in my own web application using Kubernetes API. </p>

<p>I need the same information as Kube UI and Cadvisor displays but I want to use the Kubernetes API.</p>

<p>I have found some cpu metrics under node-ip:10255/stats which contains timestamp, cpu usage: total, user and system in big weird numbers which I do not understand. Also the CPU-Limit is reported as 1024.</p>

<p>How does Kube UI calculate cpu usage and is it possible to do the same via the API?</p>

<p>If you use Kubernetes v1.2, there is a new, cleaner metrics summary API. From the release note:</p>
<blockquote>
<p>Kubelet exposes a new Alpha metrics API - /stats/summary in a user friendly format with reduced system overhead.</p>
</blockquote>
<p>You can access the endpoint through <code>&lt;node-ip&gt;:10255/stats/summary</code> and <a href="https://github.com/kubernetes/kubernetes/blob/225f903ccfcd3040554fa11c94ec2f0488498280/pkg/kubelet/api/v1alpha1/stats/types.go" rel="nofollow noreferrer">detailed API objects is here</a>.</p>
