wujimin commented on a change in pull request #987: [SCB-1017]add os cpu net
info in the metrics with linux os
URL:
https://github.com/apache/servicecomb-java-chassis/pull/987#discussion_r232486851
##########
File path:
foundations/foundation-metrics/src/main/java/org/apache/servicecomb/foundation/metrics/util/SystemOsUtil.java
##########
@@ -0,0 +1,74 @@
+package org.apache.servicecomb.foundation.metrics.util;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.util.Map;
+
+import org.apache.servicecomb.foundation.metrics.publish.spectator.CpuNode;
+import org.apache.servicecomb.foundation.metrics.publish.spectator.NetNode;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class SystemOsUtil {
+
+ private static final Logger LOGGER =
LoggerFactory.getLogger(SystemOsUtil.class);
+
+ private static final String linuxCpuCmd = "cat /proc/stat";
Review comment:
just read file directly
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services