test_class.declarator: logger = LoggerFactory.getLogger(LoadStatusCheckerTest.class)
test_class.modifier: private static
test_class.original_string: private static Logger logger = LoggerFactory.getLogger(LoadStatusCheckerTest.class);
test_class.type: Logger
test_class.var_name: logger
test_class.file: dubbo-common/src/test/java/org/apache/dubbo/common/status/support/LoadStatusCheckerTest.java
test_class.identifier: LoadStatusCheckerTest
test_case.body: @Test
      public void test() throws Exception {
          LoadStatusChecker statusChecker = new LoadStatusChecker();
          Status status = statusChecker.check();
          assertThat(status, notNullValue());
          logger.info("load status level: " + status.getLevel());
          logger.info("load status message: " + status.getMessage());
      }
test_case.class_method_signature: LoadStatusCheckerTest.test()
test_case.full_signature: @Test public void test()
test_case.identifier: test
test_case.invocations: check assertThat notNullValue info getLevel info getMessage
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void test()
focal_class.file: dubbo-common/src/main/java/org/apache/dubbo/common/status/support/LoadStatusChecker.java
focal_class.identifier: LoadStatusChecker
focal_class.interfaces: implements StatusChecker
focal_class.class_method_signature: LoadStatusChecker.check()
focal_class.full_signature: @Override public Status check()
focal_class.identifier: check
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Status
focal_class.signature: Status check()
focal_method.body: @Override
      public Status check() {
          OperatingSystemMXBean operatingSystemMXBean = ManagementFactory.getOperatingSystemMXBean();
          double load;
          try {
              Method method = OperatingSystemMXBean.class.getMethod("getSystemLoadAverage", new Class<?>[0]);
              load = (Double) method.invoke(operatingSystemMXBean, new Object[0]);
              if (load == -1) {
                  com.sun.management.OperatingSystemMXBean bean =
                          (com.sun.management.OperatingSystemMXBean) operatingSystemMXBean;
                  load = bean.getSystemCpuLoad();
              }
          } catch (Throwable e) {
              load = -1;
          }
          int cpu = operatingSystemMXBean.getAvailableProcessors();
          return new Status(load < 0 ? Status.Level.UNKNOWN : (load < cpu ? Status.Level.OK : Status.Level.WARN),
                  (load < 0 ? "" : "load:" + load + ",") + "cpu:" + cpu);
      }
focal_method.class_method_signature: LoadStatusChecker.check()
focal_method.full_signature: @Override public Status check()
focal_method.identifier: check
focal_method.invocations: getOperatingSystemMXBean getMethod invoke getSystemCpuLoad getAvailableProcessors
focal_method.modifiers: @Override public
focal_method.parameters: ()
focal_method.return: Status
focal_method.signature: Status check()