package com.huawei.usg.cloudsmn.impl;
import com.huawei.springframework.utils.JvmUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
@Component
@Slf4j
@EnableScheduling
public class JvmMonitor {
@Scheduled(fixedDelayString = JvmUtil.MONITOR_INTERVAL)
private void monitor() {
JvmUtil.recordJvmInfo();
}
}
2018-11-24 16:05:46.866 INFO 14060 --- [pool-6-thread-1] c.huawei.springframework.utils.JvmUtil : Cpu:[0.0] ThreadNum:[44] HeapMem:[531628032][268435456][3816292352][281027576] NonHeapMem:[85524480][2555904][-1][83250216]
2018-11-24 16:05:50.006 INFO 14060 --- [pool-6-thread-1] c.huawei.springframework.utils.JvmUtil : Cpu:[0.0] ThreadNum:[44] HeapMem:[531628032][268435456][3816292352][281027576] NonHeapMem:[85524480][2555904][-1][83273424]
2018-11-24 16:05:53.161 INFO 14060 --- [pool-6-thread-1] c.huawei.springframework.utils.JvmUtil : Cpu:[0.0] ThreadNum:[44] HeapMem:[531628032][268435456][3816292352][281027576] NonHeapMem:[85524480][2555904][-1][83352568]
2018-11-24 16:05:56.301 INFO 14060 --- [pool-6-thread-1] c.huawei.springframework.utils.JvmUtil : Cpu:[0.0] ThreadNum:[44] HeapMem:[531628032][268435456][3816292352][281027576] NonHeapMem:[85524480][2555904][-1][83360344]
2018-11-24 16:05:59.441 INFO 14060 --- [pool-6-thread-1] c.huawei.springframework.utils.JvmUtil : Cpu:[0.0] ThreadNum:[44] HeapMem:[531628032][268435456][3816292352][281027576] NonHeapMem:[85524480][2555904][-1][83386232]
2018-11-24 16:06:02.581 INFO 14060 --- [pool-6-thread-1] c.huawei.springframework.utils.JvmUtil : Cpu:[0.5103240268588346] ThreadNum:[44] HeapMem:[531628032][268435456][3816292352][281027576]