add stats counter for the number of outstanding async_accept calls
This commit is contained in:
parent
cc49a7fb15
commit
35ec87af4f
|
@ -465,6 +465,8 @@ namespace libtorrent {
|
||||||
num_utp_close_wait,
|
num_utp_close_wait,
|
||||||
num_utp_deleted,
|
num_utp_deleted,
|
||||||
|
|
||||||
|
num_outstanding_accept,
|
||||||
|
|
||||||
num_counters,
|
num_counters,
|
||||||
num_gauges_counters = num_counters - num_stats_counters
|
num_gauges_counters = num_counters - num_stats_counters
|
||||||
};
|
};
|
||||||
|
|
|
@ -2533,6 +2533,7 @@ namespace aux {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
std::weak_ptr<tcp::acceptor> ls(listener);
|
std::weak_ptr<tcp::acceptor> ls(listener);
|
||||||
|
m_stats_counters.inc_stats_counter(counters::num_outstanding_accept);
|
||||||
listener->async_accept(*str, [this, c, ls, ssl] (error_code const& ec)
|
listener->async_accept(*str, [this, c, ls, ssl] (error_code const& ec)
|
||||||
{ return this->wrap(&session_impl::on_accept_connection, c, ls, ec, ssl); });
|
{ return this->wrap(&session_impl::on_accept_connection, c, ls, ec, ssl); });
|
||||||
}
|
}
|
||||||
|
@ -2543,6 +2544,8 @@ namespace aux {
|
||||||
{
|
{
|
||||||
COMPLETE_ASYNC("session_impl::on_accept_connection");
|
COMPLETE_ASYNC("session_impl::on_accept_connection");
|
||||||
m_stats_counters.inc_stats_counter(counters::on_accept_counter);
|
m_stats_counters.inc_stats_counter(counters::on_accept_counter);
|
||||||
|
m_stats_counters.inc_stats_counter(counters::num_outstanding_accept, -1);
|
||||||
|
|
||||||
TORRENT_ASSERT(is_single_thread());
|
TORRENT_ASSERT(is_single_thread());
|
||||||
std::shared_ptr<tcp::acceptor> listener = listen_socket.lock();
|
std::shared_ptr<tcp::acceptor> listener = listen_socket.lock();
|
||||||
if (!listener) return;
|
if (!listener) return;
|
||||||
|
|
|
@ -252,6 +252,10 @@ namespace {
|
||||||
// the number of allowed unchoked peers
|
// the number of allowed unchoked peers
|
||||||
METRIC(ses, num_unchoke_slots)
|
METRIC(ses, num_unchoke_slots)
|
||||||
|
|
||||||
|
// the number of listen sockets that are currently accepting incoming
|
||||||
|
// connections
|
||||||
|
METRIC(ses, num_outstanding_accept)
|
||||||
|
|
||||||
// bittorrent message counters. These counters are incremented
|
// bittorrent message counters. These counters are incremented
|
||||||
// every time a message of the corresponding type is received from
|
// every time a message of the corresponding type is received from
|
||||||
// or sent to a bittorrent peer.
|
// or sent to a bittorrent peer.
|
||||||
|
|
|
@ -624,6 +624,9 @@ reports = [
|
||||||
'picker.piece_picker_rand_loops', \
|
'picker.piece_picker_rand_loops', \
|
||||||
'picker.piece_picker_busy_loops' \
|
'picker.piece_picker_busy_loops' \
|
||||||
], {'type': stacked}),
|
], {'type': stacked}),
|
||||||
|
('async_accept', 'number of outstanding accept calls', '', '', [ \
|
||||||
|
'ses.num_outstanding_accept' \
|
||||||
|
]),
|
||||||
|
|
||||||
# ('picker_full_partials_distribution', 'full pieces', '', '', ['num full partial pieces'],
|
# ('picker_full_partials_distribution', 'full pieces', '', '', ['num full partial pieces'],
|
||||||
# {'type': histogram, 'binwidth': 5, 'numbins': 120}),
|
# {'type': histogram, 'binwidth': 5, 'numbins': 120}),
|
||||||
|
|
Loading…
Reference in New Issue