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_r233082550
##########
File path:
metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/publish/DefaultLogPublisher.java
##########
@@ -102,14 +111,67 @@ protected void printLog(List<Meter> meters) {
DefaultPublishModel model = factory.createDefaultPublishModel();
printThreadPoolMetrics(model, sb);
-
+ printOsLog(factory.getTree(), sb);
printConsumerLog(model, sb);
printProducerLog(model, sb);
printEdgeLog(model, sb);
LOGGER.info(sb.toString());
}
+ protected void printOsLog(MeasurementTree tree, StringBuilder sb) {
+ if (!DynamicPropertyFactory.getInstance()
+ .getBooleanProperty(METRICS_OS_ENABLED, false)
+ .get()) {
+ return;
+ }
+ MeasurementNode OsNode =
tree.findChild(OsStatisticsMeter.OS_STATISTICS_NAME);
Review comment:
extract cpu/net to two print method
----------------------------------------------------------------
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