private static void initCpuMetrics(MetricService metricService) {
    List<String> threadModules = new ArrayList<>();
    Arrays.stream(ThreadModule.values()).forEach(x -> threadModules.add(x.toString()));
    List<String> pools = new ArrayList<>();
    Arrays.stream(ThreadName.values()).forEach(x -> pools.add(x.name()));
    metricService.addMetricSet(
        new CpuUsageMetrics(
            threadModules,
            pools,
            x -> ThreadName.getModuleTheThreadBelongs(x).toString(),
            x -> ThreadName.getThreadPoolTheThreadBelongs(x).name()));
  }
Bind predefined metric sets into DataNode.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/service/metrics/DataNodeMetricsHelper.java