| 1 package net.javacoding.jspider.core.throttle.impl; 2 3 import net.javacoding.jspider.core.throttle.Throttle; 4 import net.javacoding.jspider.core.throttle.ThrottleProvider; 5 import net.javacoding.jspider.core.util.config.PropertySet; 6 import net.javacoding.jspider.core.logging.LogFactory; 7 import net.javacoding.jspider.core.logging.Log; 8 9 10 11 19 public class SimultaneousUsersThrottleProvider implements ThrottleProvider { 20 21 public static final String THINKTIME_MIN = "thinktime.min"; 22 public static final String THINKTIME_MAX = "thinktime.max"; 23 24 public static final int THINKTIME_MIN_DEFAULT = 1000; 25 public static final int THINKTIME_MAX_DEFAULT = 1000; 26 27 28 34 public Throttle createThrottle(PropertySet props) { 35 36 Log log = LogFactory.getLog(SimultaneousUsersThrottleProvider.class); 37 38 int min = props.getInteger(THINKTIME_MIN,THINKTIME_MIN_DEFAULT); 39 int max = props.getInteger(THINKTIME_MAX,THINKTIME_MAX_DEFAULT); 40 41 log.debug("min thinktime set to " + min); 42 log.debug("max thinktime set to " + max); 43 44 return new SimultaneousUsersThrottleImpl ( min, max ); 45 } 46 47 } 48 | Popular Tags |