Skip to content

Instantly share code, notes, and snippets.

@skyrocknroll
Last active February 20, 2020 19:13
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save skyrocknroll/7c9c5b66fefb063d91756152a6bdd20e to your computer and use it in GitHub Desktop.
Save skyrocknroll/7c9c5b66fefb063d91756152a6bdd20e to your computer and use it in GitHub Desktop.
[Jolokia JVM Metrics] #jolokia #jvm #metrics
  • java -javaagent:jolokia-jvm-1.6.0-agent.jar=port=8888,host=0.0.0.0 -jar target/in.hack4geek.sppring2-1.0-SNAPSHOT.jar
  • java -jar jolokia-jvm-1.6.0-agent.jar start <pid/regex> for already running process
  • http://localhost:8778/jolokia/read/java.lang:type=Threading/ThreadCount
  • Use visualVM or JvisulaVM to get the list of Mbeans.
  • Mbean with value http://localhost:8778/jolokia/read/java.lang:name=MarkSweepCompact,type=GarbageCollector
  • The order matters java.lang:name=MarkSweepCompact,type=GarbageCollector if you try this java.lang:type=GarbageCollector,name=MarkSweepCompact this fails
  • curl "http://localhost:8778/jolokia/read/java.lang:name=MarkSweepCompact,type=GarbageCollector/LastGcInfo/memoryUsageBeforeGc" | jq
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment