<p>below is the metrics returned by the kubelet summary endpoint</p>

<pre><code>"node":{
        "nodeName":"shayeeb-virtualbox",
        "systemContainers":[ ],
        "startTime":"2018-03-05T04:52:39Z",
        "cpu":{
            "time":"2018-03-05T05:06:00Z",
            "usageNanoCores":989865279,
            "usageCoreNanoSeconds":861395314766
        },
        "memory":{
            "time":"2018-03-05T05:06:00Z",
            "availableBytes":697614336,
            "usageBytes":1809657856,
            "workingSetBytes":1378811904,
            "rssBytes":935657472,
            "pageFaults":56928,
            "majorPageFaults":70
        },
        ...
</code></pre>

<p>the cpu metric is returned in ns but i need to calculate the cpu usage from the above metric and further more I need to calculate the memory usage from the above memory metrics.I am stuck here I couldnt find any details about the above metrics .</p>

<p>As mentioned in <a href="https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/#monitoring-compute-resource-usage" rel="nofollow noreferrer">K8s Managing Compute Resources for Containers/ &quot;Monitoring compute resource usage&quot;</a>:</p>
<blockquote>
<p>The resource usage of a Pod is reported as part of the Pod status.</p>
<p>If <strong><a href="https://github.com/kubernetes/kubernetes/blob/master/cluster/addons/cluster-monitoring/README.md" rel="nofollow noreferrer">optional monitoring</a></strong> is configured for your cluster, then Pod resource usage can be retrieved from the monitoring system.</p>
</blockquote>
<p>That optional monitoring system would be <a href="https://github.com/kubernetes/heapster" rel="nofollow noreferrer"><strong><code>kubernetes/heapster</code></strong></a>, which enables Container Cluster Monitoring and Performance Analysis for Kubernetes (versions v1.0.6 and higher).<br />
It includes... <a href="https://github.com/kubernetes/heapster/blob/master/docs/overview.md" rel="nofollow noreferrer">a lot of metrics</a>.</p>
