[英]How to capture elapsed time of a running java process to raise intermediate alerts
I have a java process which could either complete sooner or take longer time based on the volume of data its processing.我有一个 java 进程,根据其处理的数据量,它可以更快地完成或花费更长的时间。 However I need a way to capture the elapsed time after certain time continuously and need to log an alert message concurrently without interrupting the main process.但是,我需要一种方法来连续捕获特定时间后的经过时间,并且需要同时记录警报消息而不中断主进程。 I have explored Future option with ExecutorService but it would terminate the process after the set timeout and raises Timeout exception.我已经使用 ExecutorService 探索了 Future 选项,但它会在设置超时后终止进程并引发超时异常。 Please suggest if you have any solution to achieve this requirement.请建议您是否有任何解决方案来实现此要求。
just some hints:只是一些提示:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.