# Convert nanocore to percentage

**URL:** <https://discuss.elastic.co/t/convert-nanocore-to-percentage/116538>\
**Category:** Beats\
**Tags:** metricbeat\
**Created:** [January 22, 2018, 9:18pm UTC](https://discuss.elastic.co/t/convert-nanocore-to-percentage/116538 "2018-01-22T21:18:53Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![kanthimathi](https://avatars.discourse-cdn.com/v4/letter/k/278dde/32.png) [@kanthimathi](https://discuss.elastic.co/u/kanthimathi)\
**Post date:** [January 22, 2018, 9:18pm UTC](https://discuss.elastic.co/t/convert-nanocore-to-percentage/116538/1 "2018-01-22T21:18:53Z")

</div>

Is there any way to convert "kubernetes.container.memory.usage" from nanocore to percentage? or any term little bigger than nanocore?

 ![51%20AM](https://us1.discourse-cdn.com/elastic/original/3X/8/2/82c19e90ed44c0fd8d55b30b5691f6af2a153e6e.jpg)

Need to convert this from nanocore to percentage?

Thanks,  
Kanthi.

---

<div class="post-metadata">

**Author:** ![exekias](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/exekias/32/28718_2.png) [@exekias](https://discuss.elastic.co/u/exekias)\
**Post date:** [January 22, 2018, 9:55pm UTC](https://discuss.elastic.co/t/convert-nanocore-to-percentage/116538/2 "2018-01-22T21:55:32Z")

</div>

Hi @kanthimathi,

I understand you are talking about cpu (not memory), isn't it? In that case, what percentage are you interested on, % of the node CPU, % the limit for that Pod or something else?

Best regards

---

<div class="post-metadata">

**Author:** ![kanthimathi](https://avatars.discourse-cdn.com/v4/letter/k/278dde/32.png) [@kanthimathi](https://discuss.elastic.co/u/kanthimathi)\
**Post date:** [January 22, 2018, 10:00pm UTC](https://discuss.elastic.co/t/convert-nanocore-to-percentage/116538/3 "2018-01-22T22:00:35Z")

</div>

@exekias sorry, My bad. I was talking about kubernetes.container.CPU.limit.nanocores, Kubernetes.container.cpu.request.nanocore and kubernetes.container.cpu.usage.nanocore. Is there any way to convert it to percentage? or any terms higher than nanocore?

 ![01%20AM](https://us1.discourse-cdn.com/elastic/original/3X/1/2/12cf3c6903048ffc3fbc4c160666487be9f5eb6e.png)

I just find an option here. But not sure how to convert and if this the right option to proceed too

---

<div class="post-metadata">

**Author:** ![exekias](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/exekias/32/28718_2.png) [@exekias](https://discuss.elastic.co/u/exekias)\
**Post date:** [January 22, 2018, 10:11pm UTC](https://discuss.elastic.co/t/convert-nanocore-to-percentage/116538/4 "2018-01-22T22:11:43Z")

</div>

You can use bucket script aggregation to calculate the % from `kubernetes.container.cpu.usage.nanocore` / `kubernetes.container.cpu.limit.nanocores`.

I'm currently working on calculating this metric from Metricbeat, to make graphing easier for this case.

---

<div class="post-metadata">

**Author:** ![kanthimathi](https://avatars.discourse-cdn.com/v4/letter/k/278dde/32.png) [@kanthimathi](https://discuss.elastic.co/u/kanthimathi)\
**Post date:** [January 25, 2018, 9:13pm UTC](https://discuss.elastic.co/t/convert-nanocore-to-percentage/116538/5 "2018-01-25T21:13:03Z")

</div>

@exekias Can you please tell what is wrong with this? I tried the aggregation filter with both sum and max. But getting an output

`The request for this panel failed. series_arithmetic script for reducer [9530aef0-0213-11e8-b222-4d1e40745993] must return a Number`

I tried using gauge.

 ![23%20AM](https://us1.discourse-cdn.com/elastic/original/3X/5/6/56483b2c42f9df26b033ab25dff66be2c6448eb8.png)

Thanks,  
Kanthi.

---

<div class="post-metadata">

**Author:** ![kanthimathi](https://avatars.discourse-cdn.com/v4/letter/k/278dde/32.png) [@kanthimathi](https://discuss.elastic.co/u/kanthimathi)\
**Post date:** [January 25, 2018, 9:34pm UTC](https://discuss.elastic.co/t/convert-nanocore-to-percentage/116538/6 "2018-01-25T21:34:39Z")

</div>

Never mind works now 😃

---

<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:** [February 22, 2018, 9:35pm UTC](https://discuss.elastic.co/t/convert-nanocore-to-percentage/116538/7 "2018-02-22T21:35:11Z")

</div>

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