21 #include "ns3/flow-probe.h"
22 #include "ns3/flow-monitor.h"
33 : m_flowMonitor (flowMonitor)
50 flow.
bytes += packetSize;
77 #define INDENT(level) for (int __xpto = 0; __xpto < level; __xpto++) os << ' ';
79 INDENT (indent); os <<
"<FlowProbe index=\"" << index <<
"\">\n";
83 for (Stats::const_iterator iter =
m_stats.begin (); iter !=
m_stats.end (); iter++)
87 <<
" flowId=\"" << iter->first <<
"\""
88 <<
" packets=\"" << iter->second.packets <<
"\""
89 <<
" bytes=\"" << iter->second.bytes <<
"\""
90 <<
" delayFromFirstProbeSum=\"" << iter->second.delayFromFirstProbeSum <<
"\""
93 for (uint32_t reasonCode = 0; reasonCode < iter->second.packetsDropped.size (); reasonCode++)
96 os <<
"<packetsDropped reasonCode=\"" << reasonCode <<
"\""
97 <<
" number=\"" << iter->second.packetsDropped[reasonCode]
100 for (uint32_t reasonCode = 0; reasonCode < iter->second.bytesDropped.size (); reasonCode++)
103 os <<
"<bytesDropped reasonCode=\"" << reasonCode <<
"\""
104 <<
" bytes=\"" << iter->second.bytesDropped[reasonCode]
108 INDENT (indent); os <<
"</FlowStats>\n";
111 INDENT (indent); os <<
"</FlowProbe>\n";
keep track of time values and allow control of global simulation resolution
smart pointer class similar to boost::intrusive_ptr
std::vector< uint64_t > bytesDropped
bytesDropped[reasonCode] => number of dropped bytes
virtual void DoDispose(void)
This method is called by Object::Dispose or by the object's destructor, whichever comes first...
void AddPacketStats(FlowId flowId, uint32_t packetSize, Time delayFromFirstProbe)
Add a packet data to the flow stats.
Ptr< FlowMonitor > m_flowMonitor
the FlowMonitor instance
uint32_t packets
Number of packets seen of this flow.
uint64_t bytes
Number of bytes seen of this flow.
std::vector< uint32_t > packetsDropped
packetsDropped[reasonCode] => number of dropped packets
Structure to hold the statistics of a flow.
void AddPacketDropStats(FlowId flowId, uint32_t packetSize, uint32_t reasonCode)
Add a packet drop data to the flow stats.
Time delayFromFirstProbeSum
divide by 'packets' to get the average delay from the first (entry) probe up to this one (partial del...
void SerializeToXmlStream(std::ostream &os, int indent, uint32_t index) const
Serializes the results to an std::ostream in XML format.
std::map< FlowId, FlowStats > Stats
Container to map FlowId -> FlowStats.
Stats GetStats() const
Get the partial flow statistics stored in this probe.
FlowProbe(FlowProbe const &)
Defined and not implemented to avoid misuse.
virtual void DoDispose(void)
This method is called by Object::Dispose or by the object's destructor, whichever comes first...
Stats m_stats
The flow stats.
uint32_t FlowId
Abstract identifier of a packet flow.