.setPort("1099")
.setNumQueryThreads(2)
.addQuery(Query.builder()
.setObj("java.lang:type=Memory")
.addAttr("HeapMemoryUsage", "NonHeapMemoryUsage")
.addOutputWriter(new StdOutWriter(ImmutableList.<String>of(), false, Collections.<String, Object>emptyMap()))
.build())
.addQuery(Query.builder()
.setObj("java.lang:name=CMS Old Gen,type=MemoryPool")
.addAttr("Usage")
.addOutputWriter(new StdOutWriter(ImmutableList.<String>of(), false, Collections.<String, Object>emptyMap()))
.build())
.addQuery(Query.builder()
.setObj("java.lang:name=ConcurrentMarkSweep,type=GarbageCollector")
.addAttr("LastGcInfo")
.addOutputWriter(new StdOutWriter(ImmutableList.<String>of(), false, Collections.<String, Object>emptyMap()))
.build())
.build();
JmxProcess process = new JmxProcess(server);
printer.prettyPrint(process);