44
55namespace sim {
66
7- Summary::Summary (std::map<Id, std::map<Id, SizeByte >> a_values)
7+ Summary::Summary (std::map<Id, std::map<Id, SpeedGbps >> a_values)
88 : m_values(std::move(a_values)) {}
99
10- Summary::Summary (const std::unordered_set<std::shared_ptr<IConnection>>& connections) {
10+ Summary::Summary (
11+ const std::unordered_set<std::shared_ptr<IConnection>>& connections) {
1112 for (const auto & conn : connections) {
1213 Id conn_id = conn->get_id ();
1314 auto flows = conn->get_flows ();
1415 for (const auto & flow : flows) {
15- m_values[conn_id].insert (std::make_pair (
16- flow->get_id (), flow->get_delivered_data_size ()));
16+ SpeedGbps throughput =
17+ flow->get_delivered_data_size () / flow->get_fct ();
18+ m_values[conn_id].insert (
19+ std::make_pair (flow->get_id (), throughput));
1720 }
1821 }
1922}
@@ -24,7 +27,7 @@ void Summary::write_to_csv(std::filesystem::path output_path) const {
2427 if (!out) {
2528 throw std::runtime_error (" Failed to create file for summary" );
2629 }
27- out << " Conn id, Flow id, Delivered data (bytes )\n " ;
30+ out << " Conn id, Flow id, Throughput (Gbps )\n " ;
2831 for (const auto & [conn_id, flows] : m_values) {
2932 for (const auto & [flow_id, value] : flows) {
3033 out << conn_id << " , " << flow_id << " , " << value << " \n " ;
0 commit comments