|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
21 #include "ns3/flow-probe.h"
22 #include "ns3/flow-monitor.h"
31 .SetGroupName (
"FlowMonitor")
44 : m_flowMonitor (flowMonitor)
88 os << std::string (
indent,
' ' ) <<
"<FlowProbe index=\"" << index <<
"\">\n";
92 for (Stats::const_iterator iter =
m_stats.begin (); iter !=
m_stats.end (); iter++)
94 os << std::string (
indent,
' ' );
96 <<
" flowId=\"" << iter->first <<
"\""
97 <<
" packets=\"" << iter->second.packets <<
"\""
98 <<
" bytes=\"" << iter->second.bytes <<
"\""
99 <<
" delayFromFirstProbeSum=\"" << iter->second.delayFromFirstProbeSum <<
"\""
102 for (uint32_t reasonCode = 0; reasonCode < iter->second.packetsDropped.size (); reasonCode++)
104 os << std::string (
indent,
' ' );
105 os <<
"<packetsDropped reasonCode=\"" << reasonCode <<
"\""
106 <<
" number=\"" << iter->second.packetsDropped[reasonCode]
109 for (uint32_t reasonCode = 0; reasonCode < iter->second.bytesDropped.size (); reasonCode++)
111 os << std::string (
indent,
' ' );
112 os <<
"<bytesDropped reasonCode=\"" << reasonCode <<
"\""
113 <<
" bytes=\"" << iter->second.bytesDropped[reasonCode]
117 os << std::string (
indent,
' ' ) <<
"</FlowStats>\n";
120 os << std::string (
indent,
' ' ) <<
"</FlowProbe>\n";
a unique identifier for an interface.
void AddPacketDropStats(FlowId flowId, uint32_t packetSize, uint32_t reasonCode)
Add a packet drop data to the flow stats.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
std::map< FlowId, FlowStats > Stats
Container to map FlowId -> FlowStats.
void AddPacketStats(FlowId flowId, uint32_t packetSize, Time delayFromFirstProbe)
Add a packet data to the flow stats.
uint32_t packets
Number of packets seen of this flow.
Ptr< FlowMonitor > m_flowMonitor
the FlowMonitor instance
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Stats GetStats() const
Get the partial flow statistics stored in this probe.
std::vector< uint64_t > bytesDropped
bytesDropped[reasonCode] => number of dropped bytes
uint32_t FlowId
Abstract identifier of a packet flow.
Smart pointer class similar to boost::intrusive_ptr.
def indent(source, debug, level)
A base class which provides memory management and object aggregation.
uint64_t bytes
Number of bytes seen of this flow.
std::vector< uint32_t > packetsDropped
packetsDropped[reasonCode] => number of dropped packets
Simulation virtual time values and global simulation resolution.
static TypeId GetTypeId(void)
Register this type.
Structure to hold the statistics of a flow.
FlowProbe(FlowProbe const &)
Defined and not implemented to avoid misuse.
Time delayFromFirstProbeSum
divide by 'packets' to get the average delay from the first (entry) probe up to this one (partial del...
virtual void DoDispose(void)
Destructor implementation.
static const uint32_t packetSize
Stats m_stats
The flow stats.
void SerializeToXmlStream(std::ostream &os, uint16_t indent, uint32_t index) const
Serializes the results to an std::ostream in XML format.
virtual void DoDispose(void)
Destructor implementation.