# Question about system.process.cpu.total.pct

**URL:** https://discuss.elastic.co/t/question-about-system-process-cpu-total-pct/78926
**Category:** Beats
**Tags:** metricbeat
**Created:** [March 16, 2017, 8:04pm UTC](https://discuss.elastic.co/t/question-about-system-process-cpu-total-pct/78926 "2017-03-16T20:04:26Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![misabel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/misabel/32/15642_2.png) [@misabel](https://discuss.elastic.co/u/misabel)
#### Post date: [March 16, 2017, 8:04pm UTC](https://discuss.elastic.co/t/question-about-system-process-cpu-total-pct/78926/1 "2017-03-16T20:04:27Z")

</div>

Hi,

If I look at the documentation for metricbeat I see the definition of system.process.cpu.total.pct as:

The percentage of CPU time spent by the process since the last update. Its value is similar to the %CPU value of the process displayed by the top command on Unix systems.

When I'm capturing those statistics using Metricbeat 5.2.2 on Windows hosts and I create a chart out of those stats in Kibana using the average of system.process.cpu.total.pct per process, the stacked bar come up to be more than 100%. That doesn't seem to match what I'm expecting. I'm expecting a breakdown of the active CPU% distributed between all the active process. Here's an example:

 ![](https://us1.discourse-cdn.com/elastic/original/3X/e/3/e3e889c47e78b7a61af1a0359e1c795b4d6be1e6.png)

Thank you!

Mathieu

---

<div class="post-metadata">

### Author: ![ruflin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ruflin/32/3116_2.png) [@ruflin](https://discuss.elastic.co/u/ruflin)
#### Post date: [March 20, 2017, 9:18am UTC](https://discuss.elastic.co/t/question-about-system-process-cpu-total-pct/78926/2 "2017-03-20T09:18:59Z")

</div>

How many CPUs / Cores do you have?

---

<div class="post-metadata">

### Author: ![misabel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/misabel/32/15642_2.png) [@misabel](https://discuss.elastic.co/u/misabel)
#### Post date: [March 20, 2017, 2:09pm UTC](https://discuss.elastic.co/t/question-about-system-process-cpu-total-pct/78926/3 "2017-03-20T14:09:31Z")

</div>

Those particular VMs have 4 CPU assigned.

---

<div class="post-metadata">

### Author: ![ruflin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ruflin/32/3116_2.png) [@ruflin](https://discuss.elastic.co/u/ruflin)
#### Post date: [March 21, 2017, 7:45am UTC](https://discuss.elastic.co/t/question-about-system-process-cpu-total-pct/78926/4 "2017-03-21T07:45:24Z")

</div>

I remember we had some discussions about this in the past but I couldn't find the Github issue ☹ I think if you have 4 CPU, the total will be 400%. That means you would have to divide all values by 4.

@andrewkroh Is that correct?

---

<div class="post-metadata">

### Author: ![misabel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/misabel/32/15642_2.png) [@misabel](https://discuss.elastic.co/u/misabel)
#### Post date: [March 21, 2017, 12:21pm UTC](https://discuss.elastic.co/t/question-about-system-process-cpu-total-pct/78926/5 "2017-03-21T12:21:37Z")

</div>

That would be one overachieving VM! 😄 The problem is that I would have to create some sort of calculated field based on the number of vCPU in that VM in order to get something meaningful across the board. I'll try to dig which metric is being grabbed in Windows to get this.

---

<div class="post-metadata">

### Author: ![andrewkroh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrewkroh/32/3784_2.png) [@andrewkroh](https://discuss.elastic.co/u/andrewkroh)
#### Post date: [March 21, 2017, 3:04pm UTC](https://discuss.elastic.co/t/question-about-system-process-cpu-total-pct/78926/6 "2017-03-21T15:04:03Z")

</div>

I think on Windows there is a discrepancy with what is reported on Linux. IIRC on Windows you get 100% max, no matter how many cores there are. I would think that the reason the bars in the chart sum to \>100% is because the x-axis buckets include data from multiple sample periods.

At the lowest level in Metricbeat here's where certain CPU related data is grabbed from the system.

`cpu` metricset data: [https://github.com/elastic/gosigar/blob/master/sys/windows/syscall\_windows.go#L214-L230](https://github.com/elastic/gosigar/blob/master/sys/windows/syscall_windows.go#L214-L230)  
`core` metricset data: [https://github.com/elastic/gosigar/blob/master/sys/windows/ntquery.go#L70-L95](https://github.com/elastic/gosigar/blob/master/sys/windows/ntquery.go#L70-L95)  
`process` metricset cpu data: [https://github.com/elastic/gosigar/blob/master/sigar\_windows.go#L326-L349](https://github.com/elastic/gosigar/blob/master/sigar_windows.go#L326-L349)

If you review this an have any recommendations for changes or updates to our documentation please let use know.

---

<div class="post-metadata">

### Author: ![maddin2016](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/maddin2016/32/16599_2.png) [@maddin2016](https://discuss.elastic.co/u/maddin2016)
#### Post date: [March 22, 2017, 11:11am UTC](https://discuss.elastic.co/t/question-about-system-process-cpu-total-pct/78926/7 "2017-03-22T11:11:18Z")

</div>

With windows performance counters you can grab the cpu usage per core

```auto
\Processor Information(0,1)\% Processor Time
\Processor Information(0,2)\% Processor Time
\Processor Information(0,3)\% Processor Time
\Processor Information(0,4)\% Processor Time
...
...

```

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [April 19, 2017, 11:11am UTC](https://discuss.elastic.co/t/question-about-system-process-cpu-total-pct/78926/8 "2017-04-19T11:11:38Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
