From c33af5a552bf3c958ffc0d542873b88a0cc5fc7f Mon Sep 17 00:00:00 2001 From: Alden Torres Date: Tue, 17 Jan 2017 18:43:52 -0500 Subject: [PATCH] added dht_invalid_find_node counter metric --- include/libtorrent/performance_counters.hpp | 1 + src/kademlia/node.cpp | 1 + src/session_stats.cpp | 1 + 3 files changed, 3 insertions(+) diff --git a/include/libtorrent/performance_counters.hpp b/include/libtorrent/performance_counters.hpp index aca8cbc55..a8a6c8159 100644 --- a/include/libtorrent/performance_counters.hpp +++ b/include/libtorrent/performance_counters.hpp @@ -238,6 +238,7 @@ namespace libtorrent dht_invalid_announce, dht_invalid_get_peers, + dht_invalid_find_node, dht_invalid_put, dht_invalid_get, diff --git a/src/kademlia/node.cpp b/src/kademlia/node.cpp index 21e51d42a..45dba70a8 100644 --- a/src/kademlia/node.cpp +++ b/src/kademlia/node.cpp @@ -863,6 +863,7 @@ void node::incoming_request(msg const& m, entry& e) bdecode_node msg_keys[2]; if (!verify_message(arg_ent, msg_desc, msg_keys, error_string)) { + m_counters.inc_stats_counter(counters::dht_invalid_find_node); incoming_error(e, error_string); return; } diff --git a/src/session_stats.cpp b/src/session_stats.cpp index fd46a1d3b..d9b64bdb1 100644 --- a/src/session_stats.cpp +++ b/src/session_stats.cpp @@ -454,6 +454,7 @@ namespace libtorrent // the number of failed incoming DHT requests by kind of request METRIC(dht, dht_invalid_announce) METRIC(dht, dht_invalid_get_peers) + METRIC(dht, dht_invalid_find_node) METRIC(dht, dht_invalid_put) METRIC(dht, dht_invalid_get)