20#include "ns3/flow-probe.h"
22#include "ns3/flow-monitor.h"
43 : m_flowMonitor(flowMonitor)
87 os << std::string(indent,
' ') <<
"<FlowProbe index=\"" << index <<
"\">\n";
91 for (Stats::const_iterator iter =
m_stats.begin(); iter !=
m_stats.end(); iter++)
93 os << std::string(indent,
' ');
95 <<
" flowId=\"" << iter->first <<
"\""
96 <<
" packets=\"" << iter->second.packets <<
"\""
97 <<
" bytes=\"" << iter->second.bytes <<
"\""
98 <<
" delayFromFirstProbeSum=\"" << iter->second.delayFromFirstProbeSum <<
"\""
101 for (
uint32_t reasonCode = 0; reasonCode < iter->second.packetsDropped.size(); reasonCode++)
103 os << std::string(indent,
' ');
104 os <<
"<packetsDropped reasonCode=\"" << reasonCode <<
"\""
105 <<
" number=\"" << iter->second.packetsDropped[reasonCode] <<
"\" />\n";
107 for (
uint32_t reasonCode = 0; reasonCode < iter->second.bytesDropped.size(); reasonCode++)
109 os << std::string(indent,
' ');
110 os <<
"<bytesDropped reasonCode=\"" << reasonCode <<
"\""
111 <<
" bytes=\"" << iter->second.bytesDropped[reasonCode] <<
"\" />\n";
114 os << std::string(indent,
' ') <<
"</FlowStats>\n";
117 os << std::string(indent,
' ') <<
"</FlowProbe>\n";
Stats m_stats
The flow stats.
void AddPacketStats(FlowId flowId, uint32_t packetSize, Time delayFromFirstProbe)
Add a packet data to the flow stats.
FlowProbe(Ptr< FlowMonitor > flowMonitor)
Constructor.
void DoDispose() override
Destructor implementation.
void AddPacketDropStats(FlowId flowId, uint32_t packetSize, uint32_t reasonCode)
Add a packet drop data to the flow stats.
std::map< FlowId, FlowStats > Stats
Container to map FlowId -> FlowStats.
Stats GetStats() const
Get the partial flow statistics stored in this probe.
static TypeId GetTypeId()
Register this type.
void SerializeToXmlStream(std::ostream &os, uint16_t indent, uint32_t index) const
Serializes the results to an std::ostream in XML format.
Ptr< FlowMonitor > m_flowMonitor
the FlowMonitor instance
A base class which provides memory management and object aggregation.
virtual void DoDispose()
Destructor implementation.
Smart pointer class similar to boost::intrusive_ptr.
Simulation virtual time values and global simulation resolution.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Structure to hold the statistics of a flow.
uint64_t bytes
Number of bytes seen of this flow.
uint32_t packets
Number of packets seen of this flow.
Time delayFromFirstProbeSum
divide by 'packets' to get the average delay from the first (entry) probe up to this one (partial del...
std::vector< uint32_t > packetsDropped
packetsDropped[reasonCode] => number of dropped packets
std::vector< uint64_t > bytesDropped
bytesDropped[reasonCode] => number of dropped bytes
static const uint32_t packetSize
Packet size generated at the AP.