You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by "OneSizeFitsQuorum (via GitHub)" <gi...@apache.org> on 2023/06/26 04:05:58 UTC

[GitHub] [iotdb] OneSizeFitsQuorum commented on a diff in pull request #10307: Add cpu usage metrics for confignode

OneSizeFitsQuorum commented on code in PR #10307:
URL: https://github.com/apache/iotdb/pull/10307#discussion_r1241486677


##########
metrics/interface/src/main/java/org/apache/iotdb/metrics/metricsets/cpu/CpuUsageMetrics.java:
##########
@@ -211,6 +217,11 @@ private void updateCpuUsage() {
     lastThreadCpuTime.putAll(currentThreadCpuTime);
     lastThreadUserTime.clear();
     lastThreadUserTime.putAll(currentThreadUserTime);
+    long timeCost = System.nanoTime() - startTime;
+    updateCount.incrementAndGet();
+    if (updateCount.get() % 10 == 0) {
+      log.info("Time for update cpu usage is {} ns", timeCost);

Review Comment:
   I recommend changing it to debug logs. If we need to check the time, we can adjust the logback, otherwise the log is too much



##########
metrics/interface/src/main/java/org/apache/iotdb/metrics/metricsets/cpu/CpuUsageMetrics.java:
##########
@@ -39,6 +42,7 @@
 import java.util.stream.Collectors;
 
 public class CpuUsageMetrics implements IMetricSet {
+  private static final Logger log = LoggerFactory.getLogger(CpuUsageMetrics.class);

Review Comment:
   user logger



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org