You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by wu...@apache.org on 2019/11/21 12:25:12 UTC

[skywalking] branch fix-cpu-unit created (now 7c28b4b)

This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a change to branch fix-cpu-unit
in repository https://gitbox.apache.org/repos/asf/skywalking.git.


      at 7c28b4b  Make CPU usage unit as 1/10000

This branch includes the following new commits:

     new 7c28b4b  Make CPU usage unit as 1/10000

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[skywalking] 01/01: Make CPU usage unit as 1/10000

Posted by wu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch fix-cpu-unit
in repository https://gitbox.apache.org/repos/asf/skywalking.git

commit 7c28b4b9f54121c2a596db3c4b99f7d5a10b787a
Author: Wu Sheng <wu...@foxmail.com>
AuthorDate: Thu Nov 21 20:24:59 2019 +0800

    Make CPU usage unit as 1/10000
---
 .../apache/skywalking/apm/agent/core/jvm/cpu/CPUMetricsAccessor.java    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/jvm/cpu/CPUMetricsAccessor.java b/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/jvm/cpu/CPUMetricsAccessor.java
index d44184b..ef7b75e 100644
--- a/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/jvm/cpu/CPUMetricsAccessor.java
+++ b/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/jvm/cpu/CPUMetricsAccessor.java
@@ -50,7 +50,7 @@ public abstract class CPUMetricsAccessor {
 
         try {
             CPU.Builder cpuBuilder = CPU.newBuilder();
-            return cpuBuilder.setUsagePercent(cpuCost * 1.0d / ((now - lastSampleTimeNs) * cpuCoreNum) * 100).build();
+            return cpuBuilder.setUsagePercent(cpuCost * 1.0d / ((now - lastSampleTimeNs) * cpuCoreNum) * 10000).build();
         } finally {
             lastCPUTimeNs = cpuTime;
             lastSampleTimeNs = now;