let the ContantTimer not throw exception when it's interrupted.
This commit is contained in:
parent
cbdfede570
commit
e7ab8f8027
|
@ -1,5 +1,6 @@
|
|||
package org.bench4q.agent.plugin.basic;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.bench4q.agent.plugin.Behavior;
|
||||
import org.bench4q.agent.plugin.Parameter;
|
||||
import org.bench4q.agent.plugin.Plugin;
|
||||
|
@ -7,6 +8,8 @@ import org.bench4q.agent.plugin.result.TimerReturn;
|
|||
|
||||
@Plugin("ConstantTimer")
|
||||
public class ConstantTimerPlugin {
|
||||
private Logger logger = Logger.getLogger(ConstantTimerPlugin.class);
|
||||
|
||||
public ConstantTimerPlugin() {
|
||||
|
||||
}
|
||||
|
@ -17,7 +20,7 @@ public class ConstantTimerPlugin {
|
|||
Thread.sleep(time);
|
||||
return new TimerReturn(true);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.info("sleep interrupted!");
|
||||
return new TimerReturn(false);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue