this.name = name + "jvm-Info";
}
@Override
public ReportEvent getMetrics() {
ReportEvent rpt = new ReportEvent(getName());
// TODO (jon) class loader
// TODO (jon) compilation
// TODO (jon) gc
// TODO (jon) mem man
// mem
MemoryMXBean mem = ManagementFactory.getMemoryMXBean();
MemoryUsage heap = mem.getHeapMemoryUsage();
rpt.setLongMetric("mem.heap.used", heap.getUsed());
rpt.setLongMetric("mem.heap.init", heap.getInit());
rpt.setLongMetric("mem.heap.max", heap.getMax());
rpt.setLongMetric("mem.heap.committed", heap.getCommitted());
MemoryUsage notheap = mem.getNonHeapMemoryUsage();
rpt.setLongMetric("mem.other.used", notheap.getUsed());
rpt.setLongMetric("mem.other.init", notheap.getInit());
rpt.setLongMetric("mem.other.max", notheap.getMax());
rpt.setLongMetric("mem.other.committed", notheap.getCommitted());
// TODO (jon) process (not in java)
// pid
// user / group / effective group id.
// ulimit / open handles (lsof)
// runtime (subset)
RuntimeMXBean rt = ManagementFactory.getRuntimeMXBean();
rpt.setStringMetric("rt.vmname", rt.getVmName());
rpt.setStringMetric("rt.vmvendor", rt.getVmVendor());
rpt.setStringMetric("rt.vmversion", rt.getVmVersion());
// TODO (jon) add date type
rpt.setStringMetric("rt.starttime", new Date(rt.getStartTime()).toString());
// current working dir.
// TODO (jon) threads
return rpt;