/** * Create the global TrafficCounter. */ void createGlobalTrafficCounter(ScheduledExecutorService executor) { if (executor == null) { throw new NullPointerException("executor"); } TrafficCounter tc = new TrafficCounter(this, executor, "GlobalTC", checkInterval); setTrafficCounter(tc); tc.start(); }
/** * Change checkInterval between two computations in millisecond. * * @param newCheckInterval The new check interval (in milliseconds) */ public void configure(long newCheckInterval) { long newInterval = newCheckInterval / 10 * 10; if (checkInterval.getAndSet(newInterval) != newInterval) { if (newInterval <= 0) { stop(); // No more active monitoring lastTime.set(milliSecondFromNano()); } else { // Start if necessary start(); } } }
/** * Create the global TrafficCounter */ void createGlobalTrafficCounter(ScheduledExecutorService executor) { // Default setMaxDeviation(DEFAULT_DEVIATION, DEFAULT_SLOWDOWN, DEFAULT_ACCELERATION); if (executor == null) { throw new IllegalArgumentException("Executor must not be null"); } TrafficCounter tc = new GlobalChannelTrafficCounter(this, executor, "GlobalChannelTC", checkInterval); setTrafficCounter(tc); tc.start(); }
/** * Create the global TrafficCounter. */ void createGlobalTrafficCounter(ScheduledExecutorService executor) { if (executor == null) { throw new NullPointerException("executor"); } TrafficCounter tc = new TrafficCounter(this, executor, "GlobalTC", checkInterval); setTrafficCounter(tc); tc.start(); }
@Override public void handlerAdded(ChannelHandlerContext ctx) throws Exception { TrafficCounter trafficCounter = new TrafficCounter(this, ctx.executor(), "ChannelTC" + ctx.channel().hashCode(), checkInterval); setTrafficCounter(trafficCounter); trafficCounter.start(); super.handlerAdded(ctx); }
/** * Change checkInterval between two computations in millisecond. * * @param newCheckInterval The new check interval (in milliseconds) */ public void configure(long newCheckInterval) { long newInterval = newCheckInterval / 10 * 10; if (checkInterval.getAndSet(newInterval) != newInterval) { if (newInterval <= 0) { stop(); // No more active monitoring lastTime.set(milliSecondFromNano()); } else { // Start if necessary start(); } } }
/** * Create the global TrafficCounter */ void createGlobalTrafficCounter(ScheduledExecutorService executor) { // Default setMaxDeviation(DEFAULT_DEVIATION, DEFAULT_SLOWDOWN, DEFAULT_ACCELERATION); if (executor == null) { throw new IllegalArgumentException("Executor must not be null"); } TrafficCounter tc = new GlobalChannelTrafficCounter(this, executor, "GlobalChannelTC", checkInterval); setTrafficCounter(tc); tc.start(); }
@Override public void handlerAdded(ChannelHandlerContext ctx) throws Exception { TrafficCounter trafficCounter = new TrafficCounter(this, ctx.executor(), "ChannelTC" + ctx.channel().hashCode(), checkInterval); setTrafficCounter(trafficCounter); trafficCounter.start(); super.handlerAdded(ctx); }
/** * Create the global TrafficCounter. */ void createGlobalTrafficCounter(ScheduledExecutorService executor) { if (executor == null) { throw new NullPointerException("executor"); } TrafficCounter tc = new TrafficCounter(this, executor, "GlobalTC", checkInterval); setTrafficCounter(tc); tc.start(); }
/** * Change checkInterval between two computations in millisecond. * * @param newCheckInterval The new check interval (in milliseconds) */ public void configure(long newCheckInterval) { long newInterval = newCheckInterval / 10 * 10; if (checkInterval.getAndSet(newInterval) != newInterval) { if (newInterval <= 0) { stop(); // No more active monitoring lastTime.set(milliSecondFromNano()); } else { // Start if necessary start(); } } }
/** * Create the global TrafficCounter */ void createGlobalTrafficCounter(ScheduledExecutorService executor) { // Default setMaxDeviation(DEFAULT_DEVIATION, DEFAULT_SLOWDOWN, DEFAULT_ACCELERATION); if (executor == null) { throw new IllegalArgumentException("Executor must not be null"); } TrafficCounter tc = new GlobalChannelTrafficCounter(this, executor, "GlobalChannelTC", checkInterval); setTrafficCounter(tc); tc.start(); }
@Override public void handlerAdded(ChannelHandlerContext ctx) throws Exception { TrafficCounter trafficCounter = new TrafficCounter(this, ctx.executor(), "ChannelTC" + ctx.channel().hashCode(), checkInterval); setTrafficCounter(trafficCounter); trafficCounter.start(); super.handlerAdded(ctx); }
/** * Create the global TrafficCounter. */ void createGlobalTrafficCounter(ScheduledExecutorService executor) { if (executor == null) { throw new NullPointerException("executor"); } TrafficCounter tc = new TrafficCounter(this, executor, "GlobalTC", checkInterval); setTrafficCounter(tc); tc.start(); }
/** * Create the global TrafficCounter. */ void createGlobalTrafficCounter(ScheduledExecutorService executor) { if (executor == null) { throw new NullPointerException("executor"); } TrafficCounter tc = new TrafficCounter(this, executor, "GlobalTC", checkInterval); setTrafficCounter(tc); tc.start(); }
/** * Create the global TrafficCounter. */ void createGlobalTrafficCounter(ScheduledExecutorService executor) { if (executor == null) { throw new NullPointerException("executor"); } TrafficCounter tc = new TrafficCounter(this, executor, "GlobalTC", checkInterval); setTrafficCounter(tc); tc.start(); }
@Override public void handlerAdded(ChannelHandlerContext ctx) throws Exception { TrafficCounter trafficCounter = new TrafficCounter(this, ctx.executor(), "ChannelTC" + ctx.channel().hashCode(), checkInterval); setTrafficCounter(trafficCounter); trafficCounter.start(); super.handlerAdded(ctx); }
/** * Create the global TrafficCounter */ void createGlobalTrafficCounter(ScheduledExecutorService executor) { // Default setMaxDeviation(DEFAULT_DEVIATION, DEFAULT_SLOWDOWN, DEFAULT_ACCELERATION); if (executor == null) { throw new IllegalArgumentException("Executor must not be null"); } TrafficCounter tc = new GlobalChannelTrafficCounter(this, executor, "GlobalChannelTC", checkInterval); setTrafficCounter(tc); tc.start(); }
/** * Create the global TrafficCounter */ void createGlobalTrafficCounter(ScheduledExecutorService executor) { // Default setMaxDeviation(DEFAULT_DEVIATION, DEFAULT_SLOWDOWN, DEFAULT_ACCELERATION); if (executor == null) { throw new IllegalArgumentException("Executor must not be null"); } TrafficCounter tc = new GlobalChannelTrafficCounter(this, executor, "GlobalChannelTC", checkInterval); setTrafficCounter(tc); tc.start(); }
@Override public void handlerAdded(ChannelHandlerContext ctx) throws Exception { TrafficCounter trafficCounter = new TrafficCounter(this, ctx.executor(), "ChannelTC" + ctx.channel().hashCode(), checkInterval); setTrafficCounter(trafficCounter); trafficCounter.start(); super.handlerAdded(ctx); }
@Override public void handlerAdded(ChannelHandlerContext ctx) throws Exception { TrafficCounter trafficCounter = new TrafficCounter(this, ctx.executor(), "ChannelTC" + ctx.channel().hashCode(), checkInterval); setTrafficCounter(trafficCounter); trafficCounter.start(); super.handlerAdded(ctx); }