You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by "BUAAserein (via GitHub)" <gi...@apache.org> on 2023/07/24 10:09:47 UTC

[GitHub] [iotdb] BUAAserein opened a new pull request, #10667: [IOTDB-6082] Improve disk space metrics

BUAAserein opened a new pull request, #10667:
URL: https://github.com/apache/iotdb/pull/10667

   see  [jira](https://issues.apache.org/jira/browse/IOTDB-6082)


-- 
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


[GitHub] [iotdb] OneSizeFitsQuorum commented on a diff in pull request #10667: [IOTDB-6082] Improve disk space metrics

Posted by "OneSizeFitsQuorum (via GitHub)" <gi...@apache.org>.
OneSizeFitsQuorum commented on code in PR #10667:
URL: https://github.com/apache/iotdb/pull/10667#discussion_r1273131167


##########
iotdb-core/metrics/interface/src/main/java/org/apache/iotdb/metrics/metricsets/net/NetMetrics.java:
##########
@@ -35,7 +36,6 @@ public class NetMetrics implements IMetricSet {
   private static final String TRANSMITTED_PACKETS = "transmitted_packets";

Review Comment:
   same



##########
iotdb-core/metrics/interface/src/main/java/org/apache/iotdb/metrics/utils/SystemMetric.java:
##########
@@ -0,0 +1,90 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iotdb.metrics.utils;
+
+// universal metric related to system
+public enum SystemMetric {
+  // disk related
+  DISK_IO_SIZE("disk_io_size"),
+  DISK_IO_OPS("disk_io_ops"),
+  DISK_IO_TIME("disk_io_time"),
+  DISK_IO_AVG_TIME("disk_io_avg_time"),
+  DISK_IO_AVG_SIZE("disk_io_avg_size"),
+  DISK_IO_SECTOR_NUM("disk_io_sector_num"),
+  DISK_IO_BUSY_PERCENTAGE("disk_io_busy_percentage"),
+  DISK_IO_QUEUE_SIZE("disk_io_queue_size"),
+  // process related
+  PROCESS_IO_SIZE("process_io_size"),
+  PROCESS_IO_OPS("process_io_ops"),
+  PROCESS_CPU_LOAD("process_cpu_load"),
+  PROCESS_CPU_TIME("process_cpu_time"),
+  PROCESS_MAX_MEM("process_max_mem"),
+  PROCESS_USED_MEM("process_used_mem"),
+  PROCESS_TOTAL_MEM("process_total_mem"),
+  PROCESS_FREE_MEM("process_free_mem"),
+  PROCESS_THREADS_COUNT("process_threads_count"),
+  PROCESS_MEM_RATIO("process_mem_ratio"),
+  PROCESS_STATUS("process_status"),
+  // system related
+  SYS_CPU_LOAD("sys_cpu_load"),
+  SYS_CPU_CORES("sys_cpu_cores"),
+  SYS_TOTAL_PHYSICAL_MEMORY_SIZE("sys_total_physical_memory_size"),
+  SYS_FREE_PHYSICAL_MEMORY_SIZE("sys_free_physical_memory_size"),
+  SYS_TOTAL_SWAP_SPACE_SIZE("sys_total_swap_space_size"),
+  SYS_FREE_SWAP_SPACE_SIZE("sys_free_swap_space_size"),
+  SYS_COMMITTED_VM_SIZE("sys_committed_vm_size"),
+  SYS_DISK_TOTAL_SPACE("sys_disk_total_space"),
+  SYS_DISK_FREE_SPACE("sys_disk_free_space"),
+  // cpu related
+  MODULE_CPU_USAGE("module_cpu_usage"),
+  POOL_CPU_USAGE("pool_cpu_usage"),
+  MODULE_USER_TIME_PERCENTAGE("module_user_time_percentage"),
+  POOL_USER_TIME_PERCENTAGE("user_time_percentage"),
+  // jvm related
+  JVM_CLASSES_LOADED_CLASSES("jvm_classes_loaded_classes"),
+  JVM_CLASSES_UNLOADED_CLASSES("jvm_classes_unloaded_classes"),
+  JVM_COMPILATION_TIME_MS("jvm_compilation_time_ms"),
+  JVM_BUFFER_COUNT_BUFFERS("jvm_buffer_count_buffers"),
+  JVM_BUFFER_MEMORY_USED_BYTES("jvm_buffer_memory_used_bytes"),
+  JVM_BUFFER_TOTAL_CAPACITY_BYTES("jvm_buffer_total_capacity_bytes"),
+  JVM_MEMORY_USED_BYTES("jvm_memory_used_bytes"),
+  JVM_MEMORY_COMMITTED_BYTES("jvm_memory_committed_bytes"),
+  JVM_MEMORY_MAX_BYTES("jvm_memory_max_bytes"),
+  JVM_THREADS_PEAK_THREADS("jvm_threads_peak_threads"),
+  JVM_THREADS_DAEMON_THREADS("jvm_threads_daemon_threads"),
+  JVM_THREADS_LIVE_THREADS("jvm_threads_live_threads"),
+  JVM_THREADS_STATUS_THREADS("jvm_threads_states_threads"),
+  JVM_GC_MAX_DATA_SIZE_BYTES("jvm_gc_max_data_size_bytes"),
+  JVM_GC_LIVE_DATA_SIZE_BYTES("jvm_gc_live_data_size_bytes"),
+  JVM_GC_MEMORY_ALLOCATED_BYTES("jvm_gc_memory_allocated_bytes"),
+  JVM_GC_MEMORY_PROMOTED_BYTES("jvm_gc_memory_promoted_bytes"),

Review Comment:
   remove `,`?



##########
iotdb-core/metrics/interface/src/main/java/org/apache/iotdb/metrics/utils/SystemTag.java:
##########
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iotdb.metrics.utils;
+
+// universal tag related to system
+public enum SystemTag {
+  TYPE("type"),
+  NAME("name"),
+  FROM("from"),
+  POOL("pool"),
+  MODULE("module"),
+  DISK("disk_id"),
+  ID("id"),
+  AREA("area"),
+  COMPILER("compiler"),
+  STATE("state"),

Review Comment:
   remove `,`?



##########
iotdb-core/metrics/interface/src/main/java/org/apache/iotdb/metrics/metricsets/disk/DiskMetrics.java:
##########
@@ -41,21 +43,6 @@ public class DiskMetrics implements IMetricSet {
   private static final String ATTEMPT_WRITE = "attempt_write";

Review Comment:
   What about these?



-- 
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


[GitHub] [iotdb] OneSizeFitsQuorum merged pull request #10667: [IOTDB-6082] Improve disk space metrics

Posted by "OneSizeFitsQuorum (via GitHub)" <gi...@apache.org>.
OneSizeFitsQuorum merged PR #10667:
URL: https://github.com/apache/iotdb/pull/10667


-- 
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


[GitHub] [iotdb] OneSizeFitsQuorum commented on a diff in pull request #10667: [IOTDB-6082] Improve disk space metrics

Posted by "OneSizeFitsQuorum (via GitHub)" <gi...@apache.org>.
OneSizeFitsQuorum commented on code in PR #10667:
URL: https://github.com/apache/iotdb/pull/10667#discussion_r1272144534


##########
iotdb-core/metrics/interface/src/main/java/org/apache/iotdb/metrics/metricsets/system/SystemMetrics.java:
##########
@@ -41,158 +35,114 @@
 import java.nio.file.Files;
 import java.nio.file.Path;
 import java.nio.file.Paths;
+import java.util.ArrayList;
 import java.util.HashSet;
 import java.util.Set;
-import java.util.concurrent.Future;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.TimeUnit;
 
 public class SystemMetrics implements IMetricSet {
   private static final Logger logger = LoggerFactory.getLogger(SystemMetrics.class);
   private static final String SYSTEM = "system";
   private final com.sun.management.OperatingSystemMXBean osMxBean;
-  private Future<?> currentServiceFuture;
-  private final ScheduledExecutorService service =
-      IoTDBThreadPoolFactory.newSingleThreadScheduledExecutor(
-          ThreadName.SYSTEM_SCHEDULE_METRICS.getName());
   private final Set<FileStore> fileStores = new HashSet<>();
-  private final boolean isDataNode;
-  private long systemDiskTotalSpace = 0L;
-  private long systemDiskFreeSpace = 0L;
-
-  public SystemMetrics(boolean isDataNode) {
-    this.isDataNode = isDataNode;
+  private final ArrayList<String> diskDirs;
+  private static final String NAME = "name";
+  private static final String SYS_CPU_LOAD = "sys_cpu_load";

Review Comment:
   can we move `org.apache.iotdb.commons.service.metric.enums.Metric` and `org.apache.iotdb.commons.service.metric.enums.Tag`  to metric module?  What's your opinion @SpriCoder 



-- 
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


[GitHub] [iotdb] SpriCoder commented on a diff in pull request #10667: [IOTDB-6082] Improve disk space metrics

Posted by "SpriCoder (via GitHub)" <gi...@apache.org>.
SpriCoder commented on code in PR #10667:
URL: https://github.com/apache/iotdb/pull/10667#discussion_r1272251547


##########
iotdb-core/metrics/interface/src/main/java/org/apache/iotdb/metrics/metricsets/system/SystemMetrics.java:
##########
@@ -41,158 +35,114 @@
 import java.nio.file.Files;
 import java.nio.file.Path;
 import java.nio.file.Paths;
+import java.util.ArrayList;
 import java.util.HashSet;
 import java.util.Set;
-import java.util.concurrent.Future;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.TimeUnit;
 
 public class SystemMetrics implements IMetricSet {
   private static final Logger logger = LoggerFactory.getLogger(SystemMetrics.class);
   private static final String SYSTEM = "system";
   private final com.sun.management.OperatingSystemMXBean osMxBean;
-  private Future<?> currentServiceFuture;
-  private final ScheduledExecutorService service =
-      IoTDBThreadPoolFactory.newSingleThreadScheduledExecutor(
-          ThreadName.SYSTEM_SCHEDULE_METRICS.getName());
   private final Set<FileStore> fileStores = new HashSet<>();
-  private final boolean isDataNode;
-  private long systemDiskTotalSpace = 0L;
-  private long systemDiskFreeSpace = 0L;
-
-  public SystemMetrics(boolean isDataNode) {
-    this.isDataNode = isDataNode;
+  private final ArrayList<String> diskDirs;
+  private static final String NAME = "name";
+  private static final String SYS_CPU_LOAD = "sys_cpu_load";

Review Comment:
   I think we can only move universal part into metric module



-- 
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


[GitHub] [iotdb] OneSizeFitsQuorum commented on a diff in pull request #10667: [IOTDB-6082] Improve disk space metrics

Posted by "OneSizeFitsQuorum (via GitHub)" <gi...@apache.org>.
OneSizeFitsQuorum commented on code in PR #10667:
URL: https://github.com/apache/iotdb/pull/10667#discussion_r1273129176


##########
iotdb-core/metrics/interface/src/main/java/org/apache/iotdb/metrics/metricsets/disk/DiskMetrics.java:
##########
@@ -41,21 +43,6 @@ public class DiskMetrics implements IMetricSet {
   private static final String ATTEMPT_WRITE = "attempt_write";

Review Comment:
   What about these?



-- 
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