mirror of
https://github.com/matrix-construct/construct
synced 2024-12-25 23:14:13 +01:00
ircd::server: Add tag completed counters on link and peer w/ report.
This commit is contained in:
parent
c0c4f838bb
commit
2031966072
4 changed files with 23 additions and 8 deletions
|
@ -29,6 +29,7 @@ struct ircd::server::link
|
|||
server::peer *peer; ///< backreference to peer
|
||||
std::shared_ptr<net::socket> socket; ///< link's socket
|
||||
std::list<tag> queue; ///< link's work queue
|
||||
size_t tag_done {0L}; ///< total tags processed
|
||||
time_t synack_ts {0L}; ///< time socket was estab
|
||||
time_t read_ts {0L}; ///< time of last read
|
||||
time_t write_ts {0L}; ///< time of last write
|
||||
|
|
|
@ -38,6 +38,7 @@ struct ircd::server::peer
|
|||
std::string server_version;
|
||||
size_t write_bytes {0};
|
||||
size_t read_bytes {0};
|
||||
size_t tag_done {0};
|
||||
bool op_resolve {false};
|
||||
bool op_fini {false};
|
||||
|
||||
|
@ -78,6 +79,7 @@ struct ircd::server::peer
|
|||
size_t link_count() const;
|
||||
size_t link_busy() const;
|
||||
size_t link_ready() const;
|
||||
size_t link_tag_done() const;
|
||||
|
||||
// stats for all tags in all links in peer
|
||||
size_t tag_count() const;
|
||||
|
|
|
@ -1121,6 +1121,7 @@ noexcept try
|
|||
if(tag.request)
|
||||
{
|
||||
assert(link.peer);
|
||||
++tag_done;
|
||||
log::logf
|
||||
{
|
||||
request::log, uint(tag.state.status) >= 300? log::DERROR: log::DEBUG,
|
||||
|
@ -1702,6 +1703,16 @@ const
|
|||
});
|
||||
}
|
||||
|
||||
size_t
|
||||
ircd::server::peer::link_tag_done()
|
||||
const
|
||||
{
|
||||
return accumulate_links([](const auto &link)
|
||||
{
|
||||
return link.tag_done;
|
||||
});
|
||||
}
|
||||
|
||||
size_t
|
||||
ircd::server::peer::link_ready()
|
||||
const
|
||||
|
@ -2425,6 +2436,7 @@ try
|
|||
peer->handle_tag_done(*this, tag);
|
||||
assert(!queue.empty());
|
||||
queue.pop_front();
|
||||
++tag_done;
|
||||
return done;
|
||||
}
|
||||
catch(const buffer_overrun &e)
|
||||
|
|
|
@ -5121,13 +5121,13 @@ try
|
|||
out
|
||||
<< std::setw(40) << std::right << "NAME" << ' '
|
||||
<< std::setw(40) << std::left << "ADDRESS" << ' '
|
||||
<< std::setw(23) << std::right << "WRITE-TOTAL" << ' '
|
||||
<< std::setw(23) << std::right << "READ-TOTAL" << ' '
|
||||
<< std::setw(19) << std::right << "WRITE-PIPE" << ' '
|
||||
<< std::setw(19) << std::right << "READ-PIPE" << ' '
|
||||
<< std::setw(4) << std::right << "LNKS" << ' '
|
||||
<< std::setw(23) << std::right << "WRITE-TOTAL" << ' '
|
||||
<< std::setw(8) << std::right << "TOTAL" << ' '
|
||||
<< std::setw(5) << std::right << "DONE" << ' '
|
||||
<< std::setw(4) << std::right << "TAGS" << ' '
|
||||
<< std::setw(4) << std::right << "PIPE" << ' '
|
||||
<< std::setw(4) << std::right << "LNKS" << ' '
|
||||
<< std::setw(15) << std::left << "FLAGS" << ' '
|
||||
<< std::setw(32) << std::left << "ERROR" << ' '
|
||||
<< std::endl;
|
||||
|
@ -5153,13 +5153,13 @@ try
|
|||
out
|
||||
<< std::setw(40) << std::right << host << ' '
|
||||
<< std::setw(40) << std::left << net::ipport{peer.remote} << ' '
|
||||
<< std::setw(23) << std::right << pretty(pbuf, iec(peer.write_total())) << ' '
|
||||
<< std::setw(23) << std::right << pretty(pbuf, iec(peer.read_total())) << ' '
|
||||
<< std::setw(19) << std::right << pretty(pbuf, iec(peer.write_size())) << ' '
|
||||
<< std::setw(19) << std::right << pretty(pbuf, iec(peer.read_size())) << ' '
|
||||
<< std::setw(4) << std::right << peer.link_count() << ' '
|
||||
<< std::setw(23) << std::right << pretty(pbuf, iec(peer.write_total())) << ' '
|
||||
<< std::setw(8) << std::right << peer.tag_done << ' '
|
||||
<< std::setw(5) << std::right << peer.link_tag_done() << ' '
|
||||
<< std::setw(4) << std::right << peer.tag_count() << ' '
|
||||
<< std::setw(4) << std::right << peer.tag_committed() << ' '
|
||||
<< std::setw(4) << std::right << peer.link_count() << ' '
|
||||
<< std::setw(15) << std::left << flags << ' '
|
||||
<< std::setw(32) << std::left << error << ' '
|
||||
<< std::endl;
|
||||
|
|
Loading…
Reference in a new issue