Skip to content

Commit

Permalink
Use ADL for to_stat_detail (...) calls
Browse files Browse the repository at this point in the history
  • Loading branch information
pwojcikdev committed Jan 25, 2024
1 parent 4ddc9d8 commit a060b53
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions nano/node/active_transactions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ void nano::active_transactions::cleanup_election (nano::unique_lock<nano::mutex>

lock_a.unlock ();

node.stats.inc (completion_type (*election), nano::to_stat_detail (election->behavior ()));
node.stats.inc (completion_type (*election), to_stat_detail (election->behavior ()));

vacancy_update ();

Expand Down Expand Up @@ -461,7 +461,7 @@ nano::election_insertion_result nano::active_transactions::insert (std::shared_p
{
cache->fill (result.election);
}
node.stats.inc (nano::stat::type::active_started, nano::to_stat_detail (election_behavior_a));
node.stats.inc (nano::stat::type::active_started, to_stat_detail (election_behavior_a));
node.observers.active_started.notify (hash);
vacancy_update ();
}
Expand Down
2 changes: 1 addition & 1 deletion nano/node/network.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ class network_message_visitor : public nano::message_visitor

void nano::network::process_message (nano::message const & message, std::shared_ptr<nano::transport::channel> const & channel)
{
node.stats.inc (nano::stat::type::message, nano::to_stat_detail (message.header.type), nano::stat::dir::in);
node.stats.inc (nano::stat::type::message, to_stat_detail (message.header.type), nano::stat::dir::in);

network_message_visitor visitor{ node, channel };
message.visit (visitor);
Expand Down
2 changes: 1 addition & 1 deletion nano/node/transport/channel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ nano::transport::channel::channel (nano::node & node_a) :
void nano::transport::channel::send (nano::message & message_a, std::function<void (boost::system::error_code const &, std::size_t)> const & callback_a, nano::transport::buffer_drop_policy drop_policy_a, nano::transport::traffic_type traffic_type)
{
auto buffer (message_a.to_shared_const_buffer ());
auto detail = nano::to_stat_detail (message_a.header.type);
auto detail = to_stat_detail (message_a.header.type);
auto is_droppable_by_limiter = (drop_policy_a == nano::transport::buffer_drop_policy::limiter);
auto should_pass (node.outbound_limiter.should_pass (buffer.size (), to_bandwidth_limit_type (traffic_type)));
if (!is_droppable_by_limiter || should_pass)
Expand Down
2 changes: 1 addition & 1 deletion nano/node/transport/inproc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ void nano::transport::inproc::channel::send_buffer (nano::shared_const_buffer co

// process message
{
node.stats.inc (nano::stat::type::message, nano::to_stat_detail (message_a->header.type), nano::stat::dir::in);
node.stats.inc (nano::stat::type::message, to_stat_detail (message_a->header.type), nano::stat::dir::in);

// create an inbound message visitor class to handle incoming messages
message_visitor_inbound visitor{ destination.network.inbound, remote_channel };
Expand Down
2 changes: 1 addition & 1 deletion nano/node/transport/tcp_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ bool nano::transport::tcp_server::process_message (std::unique_ptr<nano::message
{
return false;
}
node->stats.inc (nano::stat::type::tcp_server, nano::to_stat_detail (message->header.type), nano::stat::dir::in);
node->stats.inc (nano::stat::type::tcp_server, to_stat_detail (message->header.type), nano::stat::dir::in);

debug_assert (is_undefined_connection () || is_realtime_connection () || is_bootstrap_connection ());

Expand Down

0 comments on commit a060b53

Please sign in to comment.