public ConcurrentCommandStatusCounter copy() { ConcurrentCommandStatusCounter copy = new ConcurrentCommandStatusCounter(); for (Map.Entry<Integer,AtomicInteger> entry : this.map.entrySet()) { this.map.put(entry.getKey(), new AtomicInteger(entry.getValue().get())); } return copy; }
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(); }
@Override public String toString() { if (this.map.isEmpty()) { return ""; } SortedMap<Integer,Integer> sortedMap = createSortedMapSnapshot(); StringBuilder to = new StringBuilder(); for (Map.Entry<Integer,Integer> entry : sortedMap.entrySet()) { if (to.length() != 0) { to.append(" "); } to.append(entry.getKey()); to.append("="); to.append(entry.getValue()); } return to.toString(); }
this.counters.getRxSubmitSM().incrementResponseAndGet(); this.counters.getRxSubmitSM().addRequestEstimatedProcessingTimeAndGet(estimatedProcessingTime); this.counters.getRxSubmitSM().getResponseCommandStatusCounter().incrementAndGet(pdu.getCommandStatus()); break; case SmppConstants.CMD_ID_DELIVER_SM_RESP: this.counters.getRxDeliverSM().incrementResponseAndGet(); this.counters.getRxDeliverSM().addRequestEstimatedProcessingTimeAndGet(estimatedProcessingTime); this.counters.getRxDeliverSM().getResponseCommandStatusCounter().incrementAndGet(pdu.getCommandStatus()); break; case SmppConstants.CMD_ID_DATA_SM_RESP: this.counters.getRxDataSM().incrementResponseAndGet(); this.counters.getRxDataSM().addRequestEstimatedProcessingTimeAndGet(estimatedProcessingTime); this.counters.getRxDataSM().getResponseCommandStatusCounter().incrementAndGet(pdu.getCommandStatus()); break; case SmppConstants.CMD_ID_ENQUIRE_LINK_RESP: this.counters.getRxEnquireLink().incrementResponseAndGet(); this.counters.getRxEnquireLink().addRequestEstimatedProcessingTimeAndGet(estimatedProcessingTime); this.counters.getRxEnquireLink().getResponseCommandStatusCounter().incrementAndGet(pdu.getCommandStatus()); break;
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(); }
to.append(this.responseCommandStatusCounter.toString()); to.append("]]"); return to.toString();
counters.getRxSubmitSM().addRequestResponseTimeAndGet(responseTime); counters.getRxSubmitSM().addRequestEstimatedProcessingTimeAndGet(estimatedProcessingTime); counters.getRxSubmitSM().getResponseCommandStatusCounter().incrementAndGet(pdu.getCommandStatus()); break; case SmppConstants.CMD_ID_DELIVER_SM_RESP: counters.getRxDeliverSM().addRequestResponseTimeAndGet(responseTime); counters.getRxDeliverSM().addRequestEstimatedProcessingTimeAndGet(estimatedProcessingTime); counters.getRxDeliverSM().getResponseCommandStatusCounter().incrementAndGet(pdu.getCommandStatus()); break; case SmppConstants.CMD_ID_DATA_SM_RESP: counters.getRxDataSM().addRequestResponseTimeAndGet(responseTime); counters.getRxDataSM().addRequestEstimatedProcessingTimeAndGet(estimatedProcessingTime); counters.getRxDataSM().getResponseCommandStatusCounter().incrementAndGet(pdu.getCommandStatus()); break; case SmppConstants.CMD_ID_ENQUIRE_LINK_RESP: counters.getRxEnquireLink().addRequestResponseTimeAndGet(responseTime); counters.getRxEnquireLink().addRequestEstimatedProcessingTimeAndGet(estimatedProcessingTime); counters.getRxEnquireLink().getResponseCommandStatusCounter().incrementAndGet(pdu.getCommandStatus()); break;
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(); }
to.append(this.responseCommandStatusCounter.toString()); to.append("]]"); return to.toString();
this.counters.getRxSubmitSM().addRequestResponseTimeAndGet(responseTime); this.counters.getRxSubmitSM().addRequestEstimatedProcessingTimeAndGet(estimatedProcessingTime); this.counters.getRxSubmitSM().getResponseCommandStatusCounter().incrementAndGet(pdu.getCommandStatus()); break; case SmppConstants.CMD_ID_DELIVER_SM_RESP: this.counters.getRxDeliverSM().addRequestResponseTimeAndGet(responseTime); this.counters.getRxDeliverSM().addRequestEstimatedProcessingTimeAndGet(estimatedProcessingTime); this.counters.getRxDeliverSM().getResponseCommandStatusCounter().incrementAndGet(pdu.getCommandStatus()); break; case SmppConstants.CMD_ID_DATA_SM_RESP: this.counters.getRxDataSM().addRequestResponseTimeAndGet(responseTime); this.counters.getRxDataSM().addRequestEstimatedProcessingTimeAndGet(estimatedProcessingTime); this.counters.getRxDataSM().getResponseCommandStatusCounter().incrementAndGet(pdu.getCommandStatus()); break; case SmppConstants.CMD_ID_ENQUIRE_LINK_RESP: this.counters.getRxEnquireLink().addRequestResponseTimeAndGet(responseTime); this.counters.getRxEnquireLink().addRequestEstimatedProcessingTimeAndGet(estimatedProcessingTime); this.counters.getRxEnquireLink().getResponseCommandStatusCounter().incrementAndGet(pdu.getCommandStatus()); break;
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(); }
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(); }
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(); }
@Override public String toString() { if (this.map.isEmpty()) { return ""; } SortedMap<Integer,Integer> sortedMap = createSortedMapSnapshot(); StringBuilder to = new StringBuilder(); for (Map.Entry<Integer,Integer> entry : sortedMap.entrySet()) { if (to.length() != 0) { to.append(" "); } to.append(entry.getKey()); to.append("="); to.append(entry.getValue()); } return to.toString(); }
to.append(this.responseCommandStatusCounter.toString()); to.append("]]"); return to.toString();
this.counters.getRxSubmitSM().addRequestResponseTimeAndGet(responseTime); this.counters.getRxSubmitSM().addRequestEstimatedProcessingTimeAndGet(estimatedProcessingTime); this.counters.getRxSubmitSM().getResponseCommandStatusCounter().incrementAndGet(pdu.getCommandStatus()); break; case SmppConstants.CMD_ID_DELIVER_SM_RESP: this.counters.getRxDeliverSM().addRequestResponseTimeAndGet(responseTime); this.counters.getRxDeliverSM().addRequestEstimatedProcessingTimeAndGet(estimatedProcessingTime); this.counters.getRxDeliverSM().getResponseCommandStatusCounter().incrementAndGet(pdu.getCommandStatus()); break; case SmppConstants.CMD_ID_DATA_SM_RESP: this.counters.getRxDataSM().addRequestResponseTimeAndGet(responseTime); this.counters.getRxDataSM().addRequestEstimatedProcessingTimeAndGet(estimatedProcessingTime); this.counters.getRxDataSM().getResponseCommandStatusCounter().incrementAndGet(pdu.getCommandStatus()); break; case SmppConstants.CMD_ID_ENQUIRE_LINK_RESP: this.counters.getRxEnquireLink().addRequestResponseTimeAndGet(responseTime); this.counters.getRxEnquireLink().addRequestEstimatedProcessingTimeAndGet(estimatedProcessingTime); this.counters.getRxEnquireLink().getResponseCommandStatusCounter().incrementAndGet(pdu.getCommandStatus()); break;
public ConcurrentCommandStatusCounter copy() { ConcurrentCommandStatusCounter copy = new ConcurrentCommandStatusCounter(); for (Map.Entry<Integer,AtomicInteger> entry : this.map.entrySet()) { this.map.put(entry.getKey(), new AtomicInteger(entry.getValue().get())); } return copy; }
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(); }
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(); }
@Override public String toString() { if (this.map.isEmpty()) { return ""; } SortedMap<Integer,Integer> sortedMap = createSortedMapSnapshot(); StringBuilder to = new StringBuilder(); for (Map.Entry<Integer,Integer> entry : sortedMap.entrySet()) { if (to.length() != 0) { to.append(" "); } to.append(entry.getKey()); to.append("="); to.append(entry.getValue()); } return to.toString(); }