You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by GitBox <gi...@apache.org> on 2018/12/03 06:28:56 UTC

[GitHub] wujimin commented on a change in pull request #1012: [SCB-1044]add current process CPU rate and net packets in the metrics

wujimin commented on a change in pull request #1012: [SCB-1044]add current process CPU rate  and net packets in the metrics
URL: https://github.com/apache/servicecomb-java-chassis/pull/1012#discussion_r238155081
 
 

 ##########
 File path: metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/meter/os/CpuMeter.java
 ##########
 @@ -18,68 +18,126 @@
 
 import java.io.File;
 import java.io.IOException;
+import java.lang.management.ManagementFactory;
 import java.nio.charset.StandardCharsets;
 import java.util.List;
 
 import org.apache.commons.io.FileUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import com.netflix.spectator.api.BasicTag;
 import com.netflix.spectator.api.Id;
 import com.netflix.spectator.api.Measurement;
+import com.netflix.spectator.api.Tag;
 
 public class CpuMeter {
 
 Review comment:
   seems everything is duplicated for os and process cpu, except one source data is /proc/stat, another is /proc/{pid}/stat
   extract it and new 2 instance,

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services