From 454f6c0c18fa095505f285e283e108382fc53015 Mon Sep 17 00:00:00 2001 From: Determinant Date: Tue, 2 Jul 2019 15:16:01 -0400 Subject: uncomment the print_stat code --- salticidae | 2 +- src/hotstuff.cpp | 30 +++++++++++++++--------------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/salticidae b/salticidae index ce84260..bca672b 160000 --- a/salticidae +++ b/salticidae @@ -1 +1 @@ -Subproject commit ce842602ccac8c10d025a055c966bc32f204f75c +Subproject commit bca672b4d549e7fea43691ad387b003936ef2b8a diff --git a/src/hotstuff.cpp b/src/hotstuff.cpp index bd3a42d..12a44dc 100644 --- a/src/hotstuff.cpp +++ b/src/hotstuff.cpp @@ -291,21 +291,21 @@ void HotStuffBase::print_stat() const { LOG_INFO("--- replica msg. (10s) ---"); size_t _nsent = 0; size_t _nrecv = 0; - //for (const auto &replica: peers) - //{ - // auto conn = pn.get_peer_conn(replica); - // if (conn == nullptr) continue; - // size_t ns = conn->get_nsent(); - // size_t nr = conn->get_nrecv(); - // size_t nsb = conn->get_nsentb(); - // size_t nrb = conn->get_nrecvb(); - // conn->clear_msgstat(); - // LOG_INFO("%s: %u(%u), %u(%u), %u", - // std::string(replica).c_str(), ns, nsb, nr, nrb, part_fetched_replica[replica]); - // _nsent += ns; - // _nrecv += nr; - // part_fetched_replica[replica] = 0; - //} + for (const auto &replica: peers) + { + auto conn = pn.get_peer_conn(replica); + if (conn == nullptr) continue; + size_t ns = conn->get_nsent(); + size_t nr = conn->get_nrecv(); + size_t nsb = conn->get_nsentb(); + size_t nrb = conn->get_nrecvb(); + conn->clear_msgstat(); + LOG_INFO("%s: %u(%u), %u(%u), %u", + std::string(replica).c_str(), ns, nsb, nr, nrb, part_fetched_replica[replica]); + _nsent += ns; + _nrecv += nr; + part_fetched_replica[replica] = 0; + } nsent += _nsent; nrecv += _nrecv; LOG_INFO("sent: %lu", _nsent); -- cgit v1.2.3