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/11/11 12:48:45 UTC
[GitHub] wujimin commented on a change in pull request #987: [SCB-1017]add
os cpu net info in the metrics with linux os
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_r232486639
##########
File path: foundations/foundation-metrics/src/main/java/org/apache/servicecomb/foundation/metrics/MetricsBootstrap.java
##########
@@ -41,13 +47,37 @@
private ScheduledExecutorService executorService;
+ //cpu
+ private ScheduledExecutorService cpuExcutorService;
+
+ //network
+ private ScheduledExecutorService netExcutorService;
+
+ private CpuNode cpuNode;
+
+ private final Map<String, NetNode> netNodeMap = new HashMap<>();
+
public void start(CompositeRegistry globalRegistry, EventBus eventBus) {
this.globalRegistry = globalRegistry;
this.eventBus = eventBus;
+ cpuNode = CpuNode.getINSTANCE();
this.executorService = Executors.newScheduledThreadPool(1,
new ThreadFactoryBuilder()
.setNameFormat("spectator-poller-%d")
.build());
+ if (!System.getProperty("os.name").toLowerCase().startsWith("win")) {
Review comment:
try org.apache.commons.lang3.SystemUtils#IS_OS_LINUX
----------------------------------------------------------------
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