有没有办法通过Spring Boot获取常规的JMX属性?

时间:2019-05-29 11:03:45

标签: java spring-boot jmx

现在,JMX接口返回以下内容:

$>domain org.springframework.boot
#domain is set to org.springframework.boot
$>beans
#domain = org.springframework.boot:
org.springframework.boot:name=auditEventsEndpoint,type=Endpoint
org.springframework.boot:name=autoConfigurationReportEndpoint,type=Endpoint
org.springframework.boot:name=beansEndpoint,type=Endpoint
org.springframework.boot:name=cobaConfigurationPropertiesReportEndpoint,type=Endpoint
org.springframework.boot:name=dumpEndpoint,type=Endpoint
org.springframework.boot:name=environmentEndpoint,type=Endpoint
org.springframework.boot:name=featuresEndpoint,type=Endpoint
org.springframework.boot:name=healthEndpoint,type=Endpoint
org.springframework.boot:name=infoEndpoint,type=Endpoint
org.springframework.boot:name=loggersEndpoint,type=Endpoint
org.springframework.boot:name=metricsEndpoint,type=Endpoint
org.springframework.boot:name=requestMappingEndpoint,type=Endpoint
org.springframework.boot:name=traceEndpoint,type=Endpoint
$>bean org.springframework.boot:name=metricsEndpoint,type=Endpoint
#bean is set to org.springframework.boot:name=metricsEndpoint,type=Endpoint
$>get *
#mbean = org.springframework.boot:name=metricsEndpoint,type=Endpoint:
Data = {
  mem = 1174883;
  mem.free = 849936;
  processors = 1;
  instance.uptime = 95846;
  uptime = 148137;
  systemload.average = 0.39;
  heap.committed = 1013632;
  heap.init = 1048576;
  heap.used = 163695;
  heap = 1013632;
  nonheap.committed = 163492;
  nonheap.init = 2496;
  nonheap.used = 161257;
  nonheap = 0;
  threads.peak = 74;
  threads.daemon = 31;
  threads.totalStarted = 85;
  threads = 74;
  classes = 23288;
  classes.loaded = 23288;
  classes.unloaded = 0;
  gc.copy.count = 58;
  gc.copy.time = 2105;
  gc.marksweepcompact.count = 4;
  gc.marksweepcompact.time = 635;
  ...
}

有没有一种方法可以配置Spring Boot以返回不带数据{}的常规属性名称值对?

0 个答案:

没有答案