diff --git a/src/flow-monitor/model/flow-monitor.cc b/src/flow-monitor/model/flow-monitor.cc index 314cf6374..e04508df6 100644 --- a/src/flow-monitor/model/flow-monitor.cc +++ b/src/flow-monitor/model/flow-monitor.cc @@ -434,12 +434,12 @@ FlowMonitor::SerializeToXmlStream(std::ostream& os, indent += 2; os << std::string(indent, ' ') << "\n"; indent += 2; - for (auto flowI = m_flowStats.begin(); flowI != m_flowStats.end(); flowI++) + for (const auto& [flowId, flowStats] : m_flowStats) { os << std::string(indent, ' '); -#define ATTRIB(name) " " #name "=\"" << flowI->second.name << "\"" -#define ATTRIB_TIME(name) " " #name "=\"" << flowI->second.name.As(Time::NS) << "\"" - os << "first << "\"" << ATTRIB_TIME(timeFirstTxPacket) +#define ATTRIB(name) " " #name "=\"" << flowStats.name << "\"" +#define ATTRIB_TIME(name) " " #name "=\"" << flowStats.name.As(Time::NS) << "\"" + os << "second.packetsDropped.size(); - reasonCode++) + for (uint32_t reasonCode = 0; reasonCode < flowStats.packetsDropped.size(); reasonCode++) { os << std::string(indent, ' '); os << "second.packetsDropped[reasonCode] << "\" />\n"; + << " number=\"" << flowStats.packetsDropped[reasonCode] << "\" />\n"; } - for (uint32_t reasonCode = 0; reasonCode < flowI->second.bytesDropped.size(); reasonCode++) + for (uint32_t reasonCode = 0; reasonCode < flowStats.bytesDropped.size(); reasonCode++) { os << std::string(indent, ' '); os << "second.bytesDropped[reasonCode] << "\" />\n"; + << " bytes=\"" << flowStats.bytesDropped[reasonCode] << "\" />\n"; } if (enableHistograms) { - flowI->second.delayHistogram.SerializeToXmlStream(os, indent, "delayHistogram"); - flowI->second.jitterHistogram.SerializeToXmlStream(os, indent, "jitterHistogram"); - flowI->second.packetSizeHistogram.SerializeToXmlStream(os, - indent, - "packetSizeHistogram"); - flowI->second.flowInterruptionsHistogram.SerializeToXmlStream( - os, - indent, - "flowInterruptionsHistogram"); + flowStats.delayHistogram.SerializeToXmlStream(os, indent, "delayHistogram"); + flowStats.jitterHistogram.SerializeToXmlStream(os, indent, "jitterHistogram"); + flowStats.packetSizeHistogram.SerializeToXmlStream(os, indent, "packetSizeHistogram"); + flowStats.flowInterruptionsHistogram.SerializeToXmlStream(os, + indent, + "flowInterruptionsHistogram"); } indent -= 2;