You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2021/08/30 03:34:30 UTC

[GitHub] [skywalking] amwyyyy opened a new issue #7602: instance CPU usage exceeds 100% in 8.3.0

amwyyyy opened a new issue #7602:
URL: https://github.com/apache/skywalking/issues/7602


   Please answer these questions before submitting your issue.
   
   - Why do you submit this issue?
   - [x] Question or discussion
   - [ ] Bug
   - [ ] Requirement
   - [ ] Feature or performance improvement
   
   #### The cpu usage rate exceeds 100%. From the source code of the agent, it will not exceed 100%. What might be the cause?
   
   <img width="1859" alt="图片" src="https://user-images.githubusercontent.com/8274512/131280025-daca2ce4-9afa-4d50-99e2-b1ee03b2d22f.png">
   
   ```
       public CPU getCPUMetrics() {
           long cpuTime = this.getCpuTime();
           long cpuCost = cpuTime - lastCPUTimeNs;
           long now = System.nanoTime();
   
           try {
               CPU.Builder cpuBuilder = CPU.newBuilder();
               return cpuBuilder.setUsagePercent(cpuCost * 1.0d / ((now - lastSampleTimeNs) * cpuCoreNum) * 100).build();
           } finally {
               lastCPUTimeNs = cpuTime;
               lastSampleTimeNs = now;
           }
       }
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking] wu-sheng closed issue #7602: instance CPU usage exceeds 100% in 8.3.0

Posted by GitBox <gi...@apache.org>.
wu-sheng closed issue #7602:
URL: https://github.com/apache/skywalking/issues/7602


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org