oracle / weblogic-monitoring-exporter

WebLogic Monitoring Exporter exposes metrics and monitoring data through REST APIs for consumption by other tools (e.g. Prometheus)
Universal Permissive License v1.0
105 stars 80 forks source link

Computing WLS-exporter's CPU use using wls_scrape metrics and number of cores #261

Open arduinepo opened 1 year ago

arduinepo commented 1 year ago

Hi, I wish to get the CPU use of the WLS-exporter by dividing wls_scrape_cpu_seconds by wls_scrape_duration_seconds and the number of cores, but this formula sends some results above 100%. Was I wrong ? Thanks for helping me.

image

russgold commented 1 year ago

From the README:

The exporter produces metrics for monitoring its own performance:

They will not tell you anything useful about the overall CPU use of WebLogic Server, but only the exporter.

Is there something unclear about this documentation that could be improved?

russgold commented 1 year ago

It doesn't appear that dividing by the number of cores tells you anything useful, as indicated by this answer to a related question: https://unix.stackexchange.com/questions/211617/why-is-the-range-of-load-average-not-0-1-for-all-cpus-together

arduinepo commented 1 year ago

From the README:

The exporter produces metrics for monitoring its own performance:

  • wls_scrape_mbeans_count_total reports the number of metrics scraped.
  • wls_scrape_duration_seconds reports the time required to do the scrape.
  • wls_scrape_cpu_seconds reports the CPU time used during the scrape.

They will not tell you anything useful about the overall CPU use of WebLogic Server, but only the exporter.

Is there something unclear about this documentation that could be improved?

Thansk for your replies.

I already got the JVM CPU load from other metrics, but I need the load of this exporter to measure its impact. It seemed to me that CPUs usage could be computed by dividing CPU time by elapsed real-time (), having several cores then dividing by the number of cores I would get a number between 0 and 1.

arduinepo commented 1 year ago

It doesn't appear that dividing by the number of cores tells you anything useful, as indicated by this answer to a related question: https://unix.stackexchange.com/questions/211617/why-is-the-range-of-load-average-not-0-1-for-all-cpus-together

As they write, the load is about the number of processes running, which I don't need, but the CPU usage.

If I don't divide again by the number of cores, I get values far too greater than 1, like 3, 4 5.

arduinepo commented 1 year ago

I think my formula gets not the CPU usage as properly said, but the load measured in number of threads occupied : values are all round, 0.5, 1, 1.5, etc...

image