[svn] commit: r2718 - in /branches/trac308: ./ src/bin/auth/ src/bin/auth/benchmarks/ src/bin/auth/tests/
BIND 10 source code commits
bind10-changes at lists.isc.org
Fri Aug 13 17:24:44 UTC 2010
Author: jinmei
Date: Fri Aug 13 17:24:44 2010
New Revision: 2718
Log:
simple query benchmark
Added:
branches/trac308/src/bin/auth/benchmarks/
branches/trac308/src/bin/auth/benchmarks/Makefile.am
branches/trac308/src/bin/auth/benchmarks/query_bench.cc (with props)
Modified:
branches/trac308/configure.ac
branches/trac308/src/bin/auth/Makefile.am
branches/trac308/src/bin/auth/auth_srv.cc
branches/trac308/src/bin/auth/auth_srv.h
branches/trac308/src/bin/auth/tests/auth_srv_unittest.cc
Modified: branches/trac308/configure.ac
==============================================================================
--- branches/trac308/configure.ac (original)
+++ branches/trac308/configure.ac Fri Aug 13 17:24:44 2010
@@ -399,6 +399,7 @@
src/bin/msgq/tests/Makefile
src/bin/auth/Makefile
src/bin/auth/tests/Makefile
+ src/bin/auth/benchmarks/Makefile
src/bin/xfrin/Makefile
src/bin/xfrin/tests/Makefile
src/bin/xfrout/Makefile
Modified: branches/trac308/src/bin/auth/Makefile.am
==============================================================================
--- branches/trac308/src/bin/auth/Makefile.am (original)
+++ branches/trac308/src/bin/auth/Makefile.am Fri Aug 13 17:24:44 2010
@@ -1,4 +1,4 @@
-SUBDIRS = . tests
+SUBDIRS = . tests benchmarks
AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib
AM_CPPFLAGS += -I$(top_srcdir)/src/bin -I$(top_builddir)/src/bin
Modified: branches/trac308/src/bin/auth/auth_srv.cc
==============================================================================
--- branches/trac308/src/bin/auth/auth_srv.cc (original)
+++ branches/trac308/src/bin/auth/auth_srv.cc Fri Aug 13 17:24:44 2010
@@ -190,6 +190,16 @@
bool
AuthSrv::getVerbose() const {
return (impl_->verbose_mode_);
+}
+
+void
+AuthSrv::setCacheSlots(const size_t slots) {
+ impl_->cache_.setSlots(slots);
+}
+
+size_t
+AuthSrv::getCacheSlots() const {
+ return (impl_->cache_.getSlots());
}
void
Modified: branches/trac308/src/bin/auth/auth_srv.h
==============================================================================
--- branches/trac308/src/bin/auth/auth_srv.h (original)
+++ branches/trac308/src/bin/auth/auth_srv.h Fri Aug 13 17:24:44 2010
@@ -73,6 +73,22 @@
isc::config::ModuleCCSession* configSession() const;
void setConfigSession(isc::config::ModuleCCSession* config_session);
+ /// \brief Set or update the size (number of slots) of hot spot cache.
+ ///
+ /// If the specified size is 0, it means the size will be unlimited.
+ ///
+ /// This method never throws an exception.
+ ///
+ /// \param slots The number of cache slots.
+ void setCacheSlots(const size_t slots);
+
+ /// \brief Get the current size (number of slots) of hot spot cache.
+ ///
+ /// This method never throws an exception.
+ ///
+ /// \return The current number of cache slots.
+ size_t getCacheSlots() const;
+
///
/// Note: this interface is tentative. We'll revisit the ASIO and session
/// frameworks, at which point the session will probably be passed on
Modified: branches/trac308/src/bin/auth/tests/auth_srv_unittest.cc
==============================================================================
--- branches/trac308/src/bin/auth/tests/auth_srv_unittest.cc (original)
+++ branches/trac308/src/bin/auth/tests/auth_srv_unittest.cc Fri Aug 13 17:24:44 2010
@@ -745,4 +745,14 @@
headerCheck(parse_message, default_qid, Rcode::NOERROR(), opcode.getCode(),
QR_FLAG | AA_FLAG, 1, 1, 1, 0);
}
-}
+
+TEST_F(AuthSrvTest, cacheSlots) {
+ // simple check for the get/set operations
+ server.setCacheSlots(10); // 10 = arbitrary choice
+ EXPECT_EQ(10, server.getCacheSlots());
+
+ // 0 is a valid size
+ server.setCacheSlots(0);
+ EXPECT_EQ(00, server.getCacheSlots());
+}
+}
More information about the bind10-changes
mailing list