private void handleFinalSequenceNumber(ToaHeader header) { long startTime = statsCollector.now(); long duration = -1; try { MessageID messageID = header.getMessageID(); if (log.isTraceEnabled()) { log.trace("Received the final sequence number message with %s", header); } deliverManager.markReadyToDeliver(messageID, header.getSequencerNumber()); duration = statsCollector.now() - startTime; } catch (Exception e) { logException("Exception caught while processing the final sequence number for " + header.getMessageID(), e); } finally { statsCollector.addFinalSequenceNumberDuration(duration); } }
@Override public void resetStats() { super.resetStats(); statsCollector.clearStats(); }
public double getAvgLastProposeMessageReceivedDuration() { int count = counters.get(Counter.LAST_PROPOSE_MESSAGE_RECEIVED).get(); if (count > 0) { long dur = durations.get(Duration.LAST_PROPOSE_MESSAGE).get(); return convertNanosToMillis(dur) / count; } return 0D; }
private void handleDataMessage(Message message, ToaHeader header) { final long startTime = statsCollector.now(); try { final MessageID messageID = header.getMessageID(); //create the sequence number and put it in deliver manager long myProposeSequenceNumber = deliverManager.addRemoteMessageToDeliver(messageID, message, header.getSequencerNumber(), header.getViewId()); if (log.isTraceEnabled()) { log.trace("Received the message with %s. The proposed sequence number is %d", header, myProposeSequenceNumber); } if (myProposeSequenceNumber == -1) { //message discarded. not sending ack back. return; } //create a new message and send it back ToaHeader newHeader = ToaHeader.newProposeMessageHeader(messageID, myProposeSequenceNumber); Message proposeMessage = new Message().src(localAddress).dest(messageID.getAddress()) .putHeader(this.id, newHeader).setFlag(Message.Flag.OOB, Message.Flag.INTERNAL, Message.Flag.DONT_BUNDLE); //multicastSenderThread.addUnicastMessage(proposeMessage); down_prot.down(proposeMessage); } catch (Exception e) { logException("Exception caught while processing the data message " + header.getMessageID(), e); } finally { statsCollector.addDataMessageDuration(statsCollector.now() - startTime); } }
private void sendTotalOrderAnycastMessage(Collection<Address> destinations, Message message) { boolean trace = log.isTraceEnabled(); long startTime = statsCollector.now(); e); } finally { long duration = statsCollector.now() - startTime; statsCollector.addAnycastSentDuration(duration, (destinations.size() - (deliverToMySelf ? 1 : 0)));
private void handleSequenceNumberPropose(Address from, ToaHeader header) { long startTime = statsCollector.now(); long duration = -1; boolean lastProposeReceived = false; duration = statsCollector.now() - startTime; } catch (Exception e) { logException("Exception caught while processing the propose sequence number for " + header.getMessageID(), e); } finally { statsCollector.addProposeSequenceNumberDuration(duration, lastProposeReceived);
@ManagedAttribute(description = "The average duration (in milliseconds) in processing and sending the anycast " + "message to all the recipients") public double getAvgToaSendDuration() { return statsCollector.getAvgAnycastSentDuration(); }
@ManagedAttribute(description = "The average duration (in milliseconds) in processing a final message received") public double getAvgFinalMessageReceivedDuration() { return statsCollector.getAvgFinalMessageReceivedDuration(); }
@ManagedAttribute(description = "The number of anycast messages delivered") public int getNumberOfAnycastMessagesDelivered() { return statsCollector.getAnycastDelivered(); }
@ManagedAttribute(description = "The average duration (in milliseconds) in processing a data message received") public double getAvgDataMessageReceivedDuration() { return statsCollector.getAvgDataMessageReceivedDuration(); }
private void handleDataMessage(Message message, ToaHeader header) { final long startTime = statsCollector.now(); try { final MessageID messageID = header.getMessageID(); //create the sequence number and put it in deliver manager long myProposeSequenceNumber = deliverManager.addRemoteMessageToDeliver(messageID, message, header.getSequencerNumber(), header.getViewId()); if (log.isTraceEnabled()) { log.trace("Received the message with %s. The proposed sequence number is %d", header, myProposeSequenceNumber); } if (myProposeSequenceNumber == -1) { //message discarded. not sending ack back. return; } //create a new message and send it back ToaHeader newHeader = ToaHeader.newProposeMessageHeader(messageID, myProposeSequenceNumber); Message proposeMessage = new Message().src(localAddress).dest(messageID.getAddress()) .putHeader(this.id, newHeader).setFlag(Message.Flag.OOB, Message.Flag.INTERNAL, Message.Flag.DONT_BUNDLE); //multicastSenderThread.addUnicastMessage(proposeMessage); down_prot.down(proposeMessage); } catch (Exception e) { logException("Exception caught while processing the data message " + header.getMessageID(), e); } finally { statsCollector.addDataMessageDuration(statsCollector.now() - startTime); } }
private void sendTotalOrderAnycastMessage(Collection<Address> destinations, Message message) { boolean trace = log.isTraceEnabled(); long startTime = statsCollector.now(); e); } finally { long duration = statsCollector.now() - startTime; statsCollector.addAnycastSentDuration(duration, (destinations.size() - (deliverToMySelf ? 1 : 0)));
private void handleSequenceNumberPropose(Address from, ToaHeader header) { long startTime = statsCollector.now(); long duration = -1; boolean lastProposeReceived = false; duration = statsCollector.now() - startTime; } catch (Exception e) { logException("Exception caught while processing the propose sequence number for " + header.getMessageID(), e); } finally { statsCollector.addProposeSequenceNumberDuration(duration, lastProposeReceived);
@ManagedAttribute(description = "The average duration (in milliseconds) in processing and sending the anycast " + "message to all the recipients") public double getAvgToaSendDuration() { return statsCollector.getAvgAnycastSentDuration(); }
@ManagedAttribute(description = "The average duration (in milliseconds) in processing a final message received") public double getAvgFinalMessageReceivedDuration() { return statsCollector.getAvgFinalMessageReceivedDuration(); }
@ManagedAttribute(description = "The number of anycast messages delivered") public int getNumberOfAnycastMessagesDelivered() { return statsCollector.getAnycastDelivered(); }
@ManagedAttribute(description = "The average duration (in milliseconds) in processing a data message received") public double getAvgDataMessageReceivedDuration() { return statsCollector.getAvgDataMessageReceivedDuration(); }
public double getAvgDataMessageReceivedDuration() { int count = counters.get(Counter.DATA_MESSAGE_RECEIVED).get(); if (count > 0) { long dur = durations.get(Duration.DATA_MESSAGE).get(); return convertNanosToMillis(dur) / count; } return 0D; }
private void handleFinalSequenceNumber(ToaHeader header) { long startTime = statsCollector.now(); long duration = -1; try { MessageID messageID = header.getMessageID(); if (log.isTraceEnabled()) { log.trace("Received the final sequence number message with %s", header); } deliverManager.markReadyToDeliver(messageID, header.getSequencerNumber()); duration = statsCollector.now() - startTime; } catch (Exception e) { logException("Exception caught while processing the final sequence number for " + header.getMessageID(), e); } finally { statsCollector.addFinalSequenceNumberDuration(duration); } }
@Override public void resetStats() { super.resetStats(); statsCollector.clearStats(); }