mirror of
https://github.com/monero-project/monero.git
synced 2025-05-12 06:35:12 -04:00
Merge pull request #5327
c23ea796
New interactive daemon command 'print_net_stats': Global traffic stats (rbrunner7)
This commit is contained in:
commit
1ed6441925
13 changed files with 181 additions and 1 deletions
|
@ -268,6 +268,23 @@ namespace cryptonote
|
|||
return true;
|
||||
}
|
||||
//------------------------------------------------------------------------------------------------------------------------------
|
||||
bool core_rpc_server::on_get_net_stats(const COMMAND_RPC_GET_NET_STATS::request& req, COMMAND_RPC_GET_NET_STATS::response& res, const connection_context *ctx)
|
||||
{
|
||||
PERF_TIMER(on_get_net_stats);
|
||||
// No bootstrap daemon check: Only ever get stats about local server
|
||||
res.start_time = (uint64_t)m_core.get_start_time();
|
||||
{
|
||||
CRITICAL_REGION_LOCAL(epee::net_utils::network_throttle_manager::m_lock_get_global_throttle_in);
|
||||
epee::net_utils::network_throttle_manager::get_global_throttle_in().get_stats(res.total_packets_in, res.total_bytes_in);
|
||||
}
|
||||
{
|
||||
CRITICAL_REGION_LOCAL(epee::net_utils::network_throttle_manager::m_lock_get_global_throttle_out);
|
||||
epee::net_utils::network_throttle_manager::get_global_throttle_out().get_stats(res.total_packets_out, res.total_bytes_out);
|
||||
}
|
||||
res.status = CORE_RPC_STATUS_OK;
|
||||
return true;
|
||||
}
|
||||
//------------------------------------------------------------------------------------------------------------------------------
|
||||
class pruned_transaction {
|
||||
transaction& tx;
|
||||
public:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue