I got thrown off by the documentation here for system.cpu.user.pct.
The percentage of CPU time spent in user space. On multi-core systems, you can have percentages that are greater than 100%. For example, if 3 cores are at 60% use, then the system.cpu.user.pct will be 180%.
It seems to indicate the value is in percent. Looking at the code though, it is clear that it is a decimal value and not a percent.
If we agree this is a doc bug, I am happy to submit a PR if someone can point me to the process for that.
Hi @suryaj welcome to the forum, and thanks for the close look.
I believe both the code and the docs are correct...
A percent is a float number that is a ratio of the part divided by the total possible. When that total percent 100% is represented as a float number between 0.0 and 1.0 When the total Percent is 300% is represented as a number between 0.0 and 3.0. So 80% is equal to .80 when represented as a float. If you were to represent that value as 80.0 that would really be 8000%
You can see this if you look at the source document and then look at the same document in discover.
A percent is a float number that is a ratio of the part divided by the total possible.
I am not sure where you are applying that definition from. Percent is a number that is expressed as a fraction of 100. What you are referring to above is what is generally called ratio. If the ratio is 0.5, the equivalent percent is 50%; similarly if the ratio is 0.05, the equivalent percent is 5%.
When the total Percent is 300% is represented as a number between 0.0 and 3.0.
Are you saying this is how percentage values are represented in Elastic? This is in direct contrast to how it is referred in the doc I referred in the start of the thread, specifically this part:
For example, if 3 cores are at 60% use, then the system.cpu.user.pct will be 180%.
Based on what you are saying (and what I am seeing in code), this should perhaps say
"For example, if 3 cores are at 60% use, then the system.cpu.user.pct will be 1.8."
This will make it consistent with the default experience that a user sees when they try to visualize the system.cpu.user.pct metric.
Thanks for the reply and apologies for any confusion...
I guess what I am saying is that I see no discrepancy between the document, the data stored in elastic or how it is represented in Kibana.
1.8 and 180% represent the same value and when speaking or documenting a percent. In general people write or display 180% rather than 1.8 but when doing math or storing the data it is 1.8
If you look at the raw data in Elasticsearch as I showed about you will see the type: scaled_float 1.8 and when you look in Kibana it will recognized the format: percent and you will see 180%
So it make sense to me, but feel to write up an issue if you feel strongly about it.
What I think may have happened is that the the format:percent:defaultPattern is not properly set the default is 0,0.[000]% this is what is should look like under Management -> Advanced Settings.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.