@Override
public void doJob() throws Exception {
models.utils.LogUtils.printLogNormal("Logging JVM Stats");
MonitorProvider mp = MonitorProvider.getInstance();
PerformUsage perf = mp.getJVMMemoryUsage();
// get disk usage
mp.getFreeDiskspace();
log.info(perf.toString());
if(perf.memoryUsagePercent >= THRESHOLD_PERCENT) {
log.info("========= Live Threads List=============");
log.info(mp.getThreadUsage().toString());
log.info("========================================");
log.info("========================JVM Thread Dump====================");
ThreadInfo[] threadDump = mp.getThreadDump();
for(ThreadInfo threadInfo : threadDump) {
log.info(threadInfo.toString());
}
log.info("===========================================================");
}