794 const simtime_t statisticsStopTime = simTime();
797 recordScalar(
"Total Measurement Duration", duration);
801 unsigned long long totalSentBytes = 0;
802 unsigned long long totalSentMessages = 0;
803 for(std::map<unsigned int, SenderStatistics*>::const_iterator iterator =
SenderStatisticsMap.begin();
805 const unsigned int streamID = iterator->first;
809 const SenderStatistics* senderStatistics = iterator->second;
810 totalSentBytes += senderStatistics->SentBytes;
811 totalSentMessages += senderStatistics->SentMessages;
813 const double transmissionBitRate = (duration > 0.0) ? (8 * senderStatistics->SentBytes / duration) : 0.0;
814 const double transmissionByteRate = (duration > 0.0) ? (senderStatistics->SentBytes / duration) : 0.0;
815 const double transmissionMessageRate = (duration > 0.0) ? (senderStatistics->SentMessages / duration) : 0.0;
816 recordScalar(
format(
"Transmission Bit Rate Stream #%u", streamID).c_str(), transmissionBitRate);
817 recordScalar(
format(
"Transmission Byte Rate Stream #%u", streamID).c_str(), transmissionByteRate);
818 recordScalar(
format(
"Transmission Message Rate Stream #%u", streamID).c_str(), transmissionMessageRate);
819 recordScalar(
format(
"Sent Bytes Stream #%u", streamID).c_str(), senderStatistics->SentBytes);
820 recordScalar(
format(
"Sent Messages Stream #%u", streamID).c_str(), senderStatistics->SentMessages);
823 unsigned long long totalReceivedBytes = 0;
824 unsigned long long totalReceivedMessages = 0;
826 const unsigned int streamID = elem.first;
830 ReceiverStatistics* receiverStatistics = elem.second;
831 totalReceivedBytes += receiverStatistics->ReceivedBytes;
832 totalReceivedMessages += receiverStatistics->ReceivedMessages;
837 const double receptionBitRate = (duration > 0.0) ? (8 * receiverStatistics->ReceivedBytes / duration) : 0.0;
838 const double receptionByteRate = (duration > 0.0) ? (receiverStatistics->ReceivedBytes / duration) : 0.0;
839 const double receptionMessageRate = (duration > 0.0) ? (receiverStatistics->ReceivedMessages / duration) : 0.0;
840 recordScalar(
format(
"Reception Bit Rate Stream #%u", streamID).c_str(), receptionBitRate);
841 recordScalar(
format(
"Reception Byte Rate Stream #%u", streamID).c_str(), receptionByteRate);
842 recordScalar(
format(
"Reception Message Rate Stream #%u", streamID).c_str(), receptionMessageRate);
843 recordScalar(
format(
"Received Bytes Stream #%u", streamID).c_str(), receiverStatistics->ReceivedBytes);
844 recordScalar(
format(
"Received Messages Stream #%u", streamID).c_str(), receiverStatistics->ReceivedMessages);
845 receiverStatistics->ReceivedDelayHistogram.recordAs(
format(
"Received Message Delay Stream #%u", streamID).c_str(),
"s");
853 const double totalReceptionBitRate = (duration > 0.0) ? (8 * totalReceivedBytes / duration) : 0.0;
854 const double totalReceptionByteRate = (duration > 0.0) ? (totalReceivedBytes / duration) : 0.0;
855 const double totalReceptionMessageRate = (duration > 0.0) ? (totalReceivedMessages / duration) : 0.0;
856 const double totalTransmissionBitRate = (duration > 0.0) ? (8 * totalSentBytes / duration) : 0.0;
857 const double totalTransmissionByteRate = (duration > 0.0) ? (totalSentBytes / duration) : 0.0;
858 const double totalTransmissionMessageRate = (duration > 0.0) ? (totalSentMessages / duration) : 0.0;
862 recordScalar(
"Total Transmission Bit Rate", totalTransmissionBitRate);
863 recordScalar(
"Total Transmission Byte Rate", totalTransmissionByteRate);
864 recordScalar(
"Total Transmission Message Rate", totalTransmissionMessageRate);
865 recordScalar(
"Total Sent Bytes", totalSentBytes);
866 recordScalar(
"Total Sent Messages", totalSentMessages);
868 recordScalar(
"Total Reception Bit Rate", totalReceptionBitRate);
869 recordScalar(
"Total Reception Byte Rate", totalReceptionByteRate);
870 recordScalar(
"Total Reception Message Rate", totalReceptionMessageRate);
871 recordScalar(
"Total Received Bytes", totalReceivedBytes);
872 recordScalar(
"Total Received Messages", totalReceivedMessages);
std::map< unsigned int, ReceiverStatistics * > ReceiverStatisticsMap
Definition: NetPerfMeter.h:185
unsigned int OnOffCycleCounter
Definition: NetPerfMeter.h:107
static opp_string format(const char *formatString,...)
Definition: NetPerfMeter.cc:1231
simtime_t StatisticsStartTime
Definition: NetPerfMeter.h:148
std::map< unsigned int, SenderStatistics * > SenderStatisticsMap
Definition: NetPerfMeter.h:184
unsigned int ActualOutboundStreams
Definition: NetPerfMeter.h:114
void resetStatistics()
Definition: NetPerfMeter.cc:777
unsigned int ActualInboundStreams
Definition: NetPerfMeter.h:115