BIND 10 trac2156, updated. 6c6ff24ac1eaf91473d79c765c5ccb05b899abdb [2156] added {ipv4, ipv6}.tcp.{accept, acceptfail} and tcp.open
BIND 10 source code commits
bind10-changes at lists.isc.org
Fri Aug 31 11:12:19 UTC 2012
The branch, trac2156 has been updated
via 6c6ff24ac1eaf91473d79c765c5ccb05b899abdb (commit)
from b3d9dd1d5624efbd25f04b025ebc34e1bf533c26 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 6c6ff24ac1eaf91473d79c765c5ccb05b899abdb
Author: Kazunori Fujiwara <fujiwara at wide.ad.jp>
Date: Fri Aug 31 20:11:32 2012 +0900
[2156] added {ipv4,ipv6}.tcp.{accept,acceptfail} and tcp.open
-----------------------------------------------------------------------
Summary of changes:
src/lib/asiodns/io_fetch.cc | 1 +
src/lib/asiodns/socketstatistics.cc | 5 +++++
src/lib/asiodns/socketstatistics.h | 5 +++++
src/lib/asiodns/tcp_server.cc | 6 ++++++
4 files changed, 17 insertions(+)
-----------------------------------------------------------------------
diff --git a/src/lib/asiodns/io_fetch.cc b/src/lib/asiodns/io_fetch.cc
index a91cd1d..5628746 100644
--- a/src/lib/asiodns/io_fetch.cc
+++ b/src/lib/asiodns/io_fetch.cc
@@ -281,6 +281,7 @@ IOFetch::operator()(asio::error_code ec, size_t length) {
data_->origin = ASIODNS_OPEN_SOCKET;
if (data_->socket->isOpenSynchronous()) {
data_->socket->open(data_->remote_snd.get(), *this);
+ isc::asiodns::SocketCounter.inc(SOCKET_ASIODNS_TCP_OPEN);
} else {
CORO_YIELD data_->socket->open(data_->remote_snd.get(), *this);
}
diff --git a/src/lib/asiodns/socketstatistics.cc b/src/lib/asiodns/socketstatistics.cc
index 2ec8266..82555ce 100644
--- a/src/lib/asiodns/socketstatistics.cc
+++ b/src/lib/asiodns/socketstatistics.cc
@@ -33,6 +33,11 @@ const std::string SocketCounterItemName[SOCKET_ASIODNS_COUNTER_TYPES] = {
"asiodns_send_data_error",
"asiodns_unknown_origin",
"asiodns_unknown_result",
+ "asiodns.ipv4.tcp.accept",
+ "asiodns.ipv6.tcp.accept",
+ "asiodns.ipv4.tcp.acceptfail",
+ "asiodns.ipv6.tcp.acceptfail",
+ "asiodns.tcp.open",
};
} // namespace asiodns
diff --git a/src/lib/asiodns/socketstatistics.h b/src/lib/asiodns/socketstatistics.h
index 337cf17..393915f 100644
--- a/src/lib/asiodns/socketstatistics.h
+++ b/src/lib/asiodns/socketstatistics.h
@@ -34,6 +34,11 @@ enum SocketCounterType {
SOCKET_ASIODNS_SEND_DATA_ERROR, ///< error sending data
SOCKET_ASIODNS_UNKNOWN_ORIGIN, ///< unknown origin for ASIO error
SOCKET_ASIODNS_UNKNOWN_RESULT, ///< unknown result
+ SOCKET_ASIODNS_IPV4_TCP_ACCEPT, ///< number of IPv4 TCP accept
+ SOCKET_ASIODNS_IPV6_TCP_ACCEPT, ///< number of IPv6 TCP accept
+ SOCKET_ASIODNS_IPV4_TCP_ACCEPTFAIL, ///< number of IPv4 TCP acceptfail
+ SOCKET_ASIODNS_IPV6_TCP_ACCEPTFAIL, ///< number of IPv6 TCP acceptfail
+ SOCKET_ASIODNS_TCP_OPEN, /// number of TCP OPEN
SOCKET_ASIODNS_COUNTER_TYPES ///< The number of defined counters
};
diff --git a/src/lib/asiodns/tcp_server.cc b/src/lib/asiodns/tcp_server.cc
index 418b803..8481d76 100644
--- a/src/lib/asiodns/tcp_server.cc
+++ b/src/lib/asiodns/tcp_server.cc
@@ -67,10 +67,16 @@ TCPServer::TCPServer(io_service& io_service, int fd, int af,
try {
acceptor_.reset(new tcp::acceptor(io_service));
acceptor_->assign(af == AF_INET6 ? tcp::v6() : tcp::v4(), fd);
+ isc::asiodns::SocketCounter.inc(af == AF_INET6 ?
+ isc::asiodns::SOCKET_ASIODNS_IPV4_TCP_ACCEPT:
+ isc::asiodns::SOCKET_ASIODNS_IPV6_TCP_ACCEPT);
acceptor_->listen();
} catch (const std::exception& exception) {
// Whatever the thing throws, it is something from ASIO and we convert
// it
+ isc::asiodns::SocketCounter.inc(af == AF_INET6 ?
+ isc::asiodns::SOCKET_ASIODNS_IPV4_TCP_ACCEPTFAIL:
+ isc::asiodns::SOCKET_ASIODNS_IPV6_TCP_ACCEPTFAIL);
isc_throw(IOError, exception.what());
}
}
More information about the bind10-changes
mailing list