In docker cpu usage calculation what are: TotalUsage, SystemUsage, PercpuUsage and what does the calculation means?
<p>I see in <a href="https://github.com/docker/docker/blob/master/api/client/stats.go#L311" rel="nofollow">docker sources for cpu calculation</a> but I don't get what are exactly</p>

<ol>
<li>TotalUsage</li>
<li>SystemUsage</li>
<li>PercpuUsage</li>
</ol>

<p>why is <code>cpuDelta</code> divided by <code>SystemDelta</code> and also why then multiplied by <code>PercpuUsage</code>?</p>

<p>The documentation says for <code>cpuDelta</code></p>

<blockquote>
  <p>// calculate the change for the cpu usage of the container in between
  readings</p>
</blockquote>

<p>and for <code>systemDelta</code>:</p>

<blockquote>
  <p>// calculate the change for the entire system between readings</p>
</blockquote>

<p>so shouldn't these delta's both be summed and divided by the total cpu (or total nanoseconds passed) during that delta time? after all the <code>container</code> was consuming both the <code>cpuDelta</code> and also <code>systemDelta</code></p>

<p><strong>Update</strong>: I think I get it the totalUsage is the container usage and the SystemUsage is not the <code>systemCPU</code> used by the container but the whole system beyond the container cpu this is why they are divided.</p>