public long addRequestEstimatedProcessingTimeAndGet(long estimatedProcessingTime) { itsRequestEstimatedProcessingTimeSample.sample(estimatedProcessingTime); return this.requestEstimatedProcessingTime.addAndGet(estimatedProcessingTime); }
/** * Gets the value and reset. * * @return the value */ public String getAndReset() { synchronized (this) { final String r = (new StringBuilder(BUFF_LENGTH)).append(itsCount).append(SEPARATOR).append(getMinimum()) .append(SEPARATOR).append(getMaximum()).append(SEPARATOR).append(getAverage()).toString(); itsSum = 0L; itsCount = 0L; itsMinimum = Long.MAX_VALUE; itsMaximum = Long.MIN_VALUE; return r; } }
public ConcurrentCommandCounter() { this.request = new AtomicInteger(0); this.requestExpired = new AtomicInteger(0); this.requestWaitTime = new AtomicLong(0); this.requestResponseTime = new AtomicLong(0); this.requestEstimatedProcessingTime = new AtomicLong(0); this.response = new AtomicInteger(0); this.responseCommandStatusCounter = new ConcurrentCommandStatusCounter(); itsRequestWaitTimeSample = new StatisticsSample(); itsRequestResponseTimeSample = new StatisticsSample(); itsRequestEstimatedProcessingTimeSample = new StatisticsSample(); }
public void reset() { this.request.set(0); this.requestExpired.set(0); this.requestWaitTime.set(0); this.requestResponseTime.set(0); this.requestEstimatedProcessingTime.set(0); this.response.set(0); this.responseCommandStatusCounter.reset(); itsRequestWaitTimeSample.reset(); itsRequestResponseTimeSample.reset(); itsRequestEstimatedProcessingTimeSample.reset(); }
/** * Dump and reset. * * @return the string */ public String dumpAndReset() { final StringBuilder sb = new StringBuilder(BUFF_LENGTH); sb.append(request.get()).append(SEPARATOR); sb.append(requestExpired.get()).append(SEPARATOR); sb.append(response.get()).append(SEPARATOR); sb.append(itsRequestWaitTimeSample.getAndReset()).append(SEPARATOR); sb.append(itsRequestResponseTimeSample.getAndReset()).append(SEPARATOR); sb.append(itsRequestEstimatedProcessingTimeSample.getAndReset()); return sb.toString(); }
public ConcurrentCommandCounter(int request, int requestExpired, long requestWaitTime, long requestResponseTime, long requestEstimatedProcessingTime, int response, final ConcurrentCommandStatusCounter responseCommandStatusCounter) { this.request = new AtomicInteger(request); this.requestExpired = new AtomicInteger(requestExpired); this.requestWaitTime = new AtomicLong(requestWaitTime); this.requestResponseTime = new AtomicLong(requestResponseTime); this.requestEstimatedProcessingTime = new AtomicLong(requestEstimatedProcessingTime); this.response = new AtomicInteger(response); this.responseCommandStatusCounter = responseCommandStatusCounter.copy(); itsRequestWaitTimeSample = new StatisticsSample(); itsRequestResponseTimeSample = new StatisticsSample(); itsRequestEstimatedProcessingTimeSample = new StatisticsSample(); }
public long addRequestWaitTimeAndGet(long waitTime) { itsRequestWaitTimeSample.sample(waitTime); return this.requestWaitTime.addAndGet(waitTime); }
public long addRequestResponseTimeAndGet(long responseTime) { itsRequestResponseTimeSample.sample(responseTime); return this.requestResponseTime.addAndGet(responseTime); }