一、actuator 配置
二 、actuator 首页
http://localhost:19988/duno/ph/insp/ 查看所有链接
{"_links":{"self":{"href":"http://localhost:19988/duno/ph/insp","templated":false},"archaius":{"href":"http://localhost:19988/duno/ph/insp/archaius","templated":false},"beans":{"href":"http://localhost:19988/duno/ph/insp/beans","templated":false},"caches-cache":{"href":"http://localhost:19988/duno/ph/insp/caches/{cache}","templated":true},"caches":{"href":"http://localhost:19988/duno/ph/insp/caches","templated":false},"health-path":{"href":"http://localhost:19988/duno/ph/insp/health/{*path}","templated":true},"health":{"href":"http://localhost:19988/duno/ph/insp/health","templated":false},"info":{"href":"http://localhost:19988/duno/ph/insp/info","templated":false},"conditions":{"href":"http://localhost:19988/duno/ph/insp/conditions","templated":false},"configprops":{"href":"http://localhost:19988/duno/ph/insp/configprops","templated":false},"env":{"href":"http://localhost:19988/duno/ph/insp/env","templated":false},"env-toMatch":{"href":"http://localhost:19988/duno/ph/insp/env/{toMatch}","templated":true},"logfile":{"href":"http://localhost:19988/duno/ph/insp/logfile","templated":false},"loggers-name":{"href":"http://localhost:19988/duno/ph/insp/loggers/{name}","templated":true},"loggers":{"href":"http://localhost:19988/duno/ph/insp/loggers","templated":false},"heapdump":{"href":"http://localhost:19988/duno/ph/insp/heapdump","templated":false},"threaddump":{"href":"http://localhost:19988/duno/ph/insp/threaddump","templated":false},"metrics-requiredMetricName":{"href":"http://localhost:19988/duno/ph/insp/metrics/{requiredMetricName}","templated":true},"metrics":{"href":"http://localhost:19988/duno/ph/insp/metrics","templated":false},"scheduledtasks":{"href":"http://localhost:19988/duno/ph/insp/scheduledtasks","templated":false},"mappings":{"href":"http://localhost:19988/duno/ph/insp/mappings","templated":false},"refresh":{"href":"http://localhost:19988/duno/ph/insp/refresh","templated":false},"features":{"href":"http://localhost:19988/duno/ph/insp/features","templated":false}}}
三、各种指标
http://localhost:19988/duno/ph/insp/metrics/
{"names":["jvm.memory.max","jvm.threads.states","jvm.gc.memory.promoted","jvm.memory.used","jvm.gc.max.data.size","jvm.memory.committed","system.cpu.count","logback.events","jvm.buffer.memory.used","tomcat.sessions.created","jvm.threads.daemon","system.cpu.usage","jvm.gc.memory.allocated","tomcat.sessions.expired","jvm.threads.live","jvm.threads.peak","process.uptime","tomcat.sessions.rejected","process.cpu.usage","jvm.classes.loaded","jvm.gc.pause","jvm.classes.unloaded","tomcat.sessions.active.current","tomcat.sessions.alive.max","jvm.gc.live.data.size","jvm.buffer.count","jvm.buffer.total.capacity","tomcat.sessions.active.max","process.start.time"]}
{"name":"jvm.threads.daemon","description":"The current number of live daemon threads","baseUnit":"threads","measurements":[{"statistic":"VALUE","value":19.0}],"availableTags":[]}
{"name":"system.cpu.usage","description":"The \"recent cpu usage\" for the whole system","baseUnit":null,"measurements":[{"statistic":"VALUE","value":0.06997869445315397}],"availableTags":[]}
/metrics/jvm.memory.max?tag=area:heap
{"name":"jvm.memory.max","description":"The maximum amount of memory in bytes that can be used for memory management","baseUnit":"bytes","measurements":[{"statistic":"VALUE","value":2.075131904E9}],"availableTags":[{"tag":"id","values":["PS Eden Space","PS Survivor Space","PS Old Gen"]}]}
/metrics/jvm.memory.max?tag=area:heap&tag=id:PS%20Survivor%20Space
{"name":"jvm.memory.max","description":"The maximum amount of memory in bytes that can be used for memory management","baseUnit":"bytes","measurements":[{"statistic":"VALUE","value":4.6137344E7}],"availableTags":[]}
http://localhost:19988/duno/ph/insp/health
{"status":"DOWN","components":{"db":{"status":"UP","details":{"database":"MySQL","result":1,"validationQuery":"/* ping */ SELECT 1"}},"discoveryComposite":{"description":"Discovery Client not initialized","status":"UNKNOWN","components":{"discoveryClient":{"description":"Discovery Client not initialized","status":"UNKNOWN"}}},"diskSpace":{"status":"UP","details":{"total":440823443456,"free":342115520512,"threshold":10485760}},"hystrix":{"status":"UP"},"ping":{"status":"UP"},"redis":{"status":"DOWN","details":{"error":"org.springframework.data.redis.RedisConnectionFailureException: Cannot get Jedis connection; nested exception is redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool"}},"refreshScope":{"status":"UP"}}}
http://localhost:19988/duno/ph/insp/heapdump 下载dump文件
http://localhost:19988/duno/ph/insp/threaddump 展示threaddump
http://localhost:19988/duno/ph/insp/scheduledtasks
{"cron":[{"runnable":{"target":"com.yun.ph.insp.domain.task.UrlCorrectTask.execute"},"expression":"0 30 20 * * ?"},{"runnable":{"target":"com.yun.ph.insp.domain.task.AuditMsgTask.execute"},"expression":"0 0 8 * * ?"}],"fixedDelay":[],"fixedRate":[],"custom":[]}
docker配置了4核,实际查看还是32个
http://localhost:19988/duno/ph/ins/metrics/system.cpu.count
{"name":"system.cpu.count","description":"The number of processors available to the Java virtual machine","baseUnit":null,"measurements":[{"statistic":"VALUE","value":32.0}],"availableTags":[]}