private static void checkAndUpdate(ThreadMXBean threadBean) {
    if (System.currentTimeMillis() - lastUpdateTime < MetricConstant.UPDATE_INTERVAL) {
      return;
    }
    lastUpdateTime = System.currentTimeMillis();
    threadStateCountMap.clear();
    List<ThreadInfo> infoList =
        Arrays.asList(threadBean.getThreadInfo(threadBean.getAllThreadIds()));
    infoList.forEach(
        info -> {
          if (info != null) {
            Thread.State state = info.getThreadState();
            threadStateCountMap.compute(state, (k, v) -> v == null ? 1 : v + 1);
          }
        });
  }
This file is modified from io.micrometer.core.instrument.binder.jvm.JvmThreadMetrics
iotdb-core/metrics/interface/src/main/java/org/apache/iotdb/metrics/metricsets/jvm/JvmThreadMetrics.java