Skip to content

Commit c277e31

Browse files
author
Alexey Zharkov
committed
changes by review
1 parent ce7d02c commit c277e31

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

source/utils/summary.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Summary::Summary(
2828
"{} bytes",
2929
flow->get_id(), conn_id, sent.value(), delivered.value()));
3030
}
31-
double overhead = (sent.value()/delivered.value() - 1) * 100;
31+
double overhead = (sent.value() / delivered.value() - 1) * 100;
3232

3333
const TimeNs fct = flow->get_fct();
3434
SizeByte packet_size = flow->get_packet_size();
@@ -40,9 +40,9 @@ Summary::Summary(
4040
SizeByte retransmit_size = retransmit_count * packet_size;
4141

4242
m_values[conn_id][flow->get_id()] =
43-
FlowSummary{sent, delivered, packet_size,
44-
overhead, retransmit_size, retransmit_count,
45-
sending_rate, throughput, fct};
43+
FlowSummary{sent, delivered, packet_size,
44+
overhead, retransmit_size, retransmit_count,
45+
sending_rate, throughput, fct};
4646
}
4747
if (expt_data_delivery > real_data_delivery) {
4848
m_errors.emplace_back(fmt::format(
@@ -74,9 +74,11 @@ void Summary::write_to_csv(std::filesystem::path& output_path) const {
7474
}
7575
}
7676
out.close();
77+
}
78+
79+
void Summary::check() const {
7780
if (!m_errors.empty()) {
7881
throw std::runtime_error(fmt::format("{}", fmt::join(m_errors, "\n")));
7982
}
8083
}
81-
8284
} // namespace sim

source/utils/summary.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ class Summary {
3131
const std::unordered_set<std::shared_ptr<IConnection>>& connections);
3232

3333
void write_to_csv(std::filesystem::path& output_path) const;
34+
void check() const;
3435

3536
private:
3637
std::map<Id, std::map<Id, FlowSummary>> m_values;

0 commit comments

Comments
 (0)