Put statistics classes into isc::auth::statistics namespace.
Rename AuthCounters to Counters.
using namespace isc::asiolink;
using namespace isc::asiodns;
using namespace isc::server_common::portconfig;
+using isc::auth::statistics::Counters;
namespace {
// A helper class for cleaning up message renderer.
AbstractSession* xfrin_session_;
/// Query counters for statistics
- AuthCounters counters_;
+ Counters counters_;
/// Addresses we listen on
AddressList listen_addresses_;
AuthSrvImpl::incCounter(const int protocol) {
// Increment query counter.
if (protocol == IPPROTO_UDP) {
- counters_.inc(AuthCounters::SERVER_UDP_QUERY);
+ counters_.inc(Counters::SERVER_UDP_QUERY);
} else if (protocol == IPPROTO_TCP) {
- counters_.inc(AuthCounters::SERVER_TCP_QUERY);
+ counters_.inc(Counters::SERVER_TCP_QUERY);
} else {
// unknown protocol
isc_throw(Unexpected, "Unknown protocol: " << protocol);
}
uint64_t
-AuthSrv::getCounter(const AuthCounters::ServerCounterType type) const {
+AuthSrv::getCounter(const Counters::ServerCounterType type) const {
return (impl_->counters_.getCounter(type));
}
/// \brief Returns statistics data
///
/// This function can throw an exception from
- /// AuthCounters::getStatistics().
+ /// Counters::getStatistics().
///
/// \return JSON format statistics data.
isc::data::ConstElementPtr getStatistics() const;
- /// \brief Get the value of counter in the AuthCounters.
+ /// \brief Get the value of counter in the Counters.
///
- /// This function calls AuthCounters::getStatistics() and
+ /// This function calls Counters::getStatistics() and
/// returns its return value.
///
/// This function never throws an exception as far as
- /// AuthCounters::getStatistics() doesn't throw.
+ /// Counters::getStatistics() doesn't throw.
///
/// Note: Currently this function is for testing purpose only.
///
///
/// \return the value of the counter.
- uint64_t getCounter(const AuthCounters::ServerCounterType type) const;
+ uint64_t getCounter(
+ const isc::auth::statistics::Counters::ServerCounterType type)
+ const;
/// \brief Get the value of per Opcode counter in the Auth Counters.
///
- /// This function calls AuthCounters::getCounter(isc::dns::Opcode) and
+ /// This function calls Counters::getCounter(isc::dns::Opcode) and
/// returns its return value.
///
/// \note This is a tentative interface as an attempt of experimentally
/// \brief Get the value of per Rcode counter in the Auth Counters.
///
- /// This function calls AuthCounters::getCounter(isc::dns::Rcode) and
+ /// This function calls Counters::getCounter(isc::dns::Rcode) and
/// returns its return value.
///
/// \note This is a tentative interface as an attempt of experimentally
using namespace isc::auth;
using namespace isc::statistics;
-// TODO: We need a namespace ("auth_server"?) to hold
-// AuthSrv and AuthCounters.
+namespace isc {
+namespace auth {
+namespace statistics {
// TODO: Make use of wrappers like isc::dns::Opcode
// for counter item type.
-class AuthCountersImpl : boost::noncopyable {
+class CountersImpl : boost::noncopyable {
public:
- AuthCountersImpl();
- ~AuthCountersImpl();
- void inc(const AuthCounters::ServerCounterType type);
+ CountersImpl();
+ ~CountersImpl();
+ void inc(const Counters::ServerCounterType type);
void inc(const Opcode opcode) {
opcode_counter_.inc(opcode.getCode());
}
void inc(const Rcode rcode) {
rcode_counter_.inc(rcode.getCode());
}
- void inc(const std::string& zone,
- const AuthCounters::PerZoneCounterType type);
+ void inc(const std::string& zone, const Counters::PerZoneCounterType type);
isc::data::ConstElementPtr getStatistics() const;
- void registerStatisticsValidator
- (AuthCounters::validator_type validator);
+ void registerStatisticsValidator (Counters::validator_type validator);
// Currently for testing purpose only
- uint64_t getCounter(const AuthCounters::ServerCounterType type) const;
+ uint64_t getCounter(const Counters::ServerCounterType type) const;
uint64_t getCounter(const Opcode opcode) const {
return (opcode_counter_.get(opcode.getCode()));
}
Counter rcode_counter_;
static const size_t NUM_RCODES = 17;
CounterDictionary per_zone_counter_;
- AuthCounters::validator_type validator_;
+ Counters::validator_type validator_;
};
-AuthCountersImpl::AuthCountersImpl() :
+CountersImpl::CountersImpl() :
// initialize counter
- // size of server_counter_: AuthCounters::SERVER_COUNTER_TYPES
- // size of per_zone_counter_: AuthCounters::PER_ZONE_COUNTER_TYPES
- server_counter_(AuthCounters::SERVER_COUNTER_TYPES),
+ // size of server_counter_: Counters::SERVER_COUNTER_TYPES
+ // size of per_zone_counter_: Counters::PER_ZONE_COUNTER_TYPES
+ server_counter_(Counters::SERVER_COUNTER_TYPES),
opcode_counter_(NUM_OPCODES), rcode_counter_(NUM_RCODES),
- per_zone_counter_(AuthCounters::PER_ZONE_COUNTER_TYPES)
+ per_zone_counter_(Counters::PER_ZONE_COUNTER_TYPES)
{
per_zone_counter_.addElement("_SERVER_");
}
-AuthCountersImpl::~AuthCountersImpl()
+CountersImpl::~CountersImpl()
{}
void
-AuthCountersImpl::inc(const AuthCounters::ServerCounterType type) {
+CountersImpl::inc(const Counters::ServerCounterType type) {
server_counter_.inc(type);
}
void
-AuthCountersImpl::inc(const std::string& zone,
- const AuthCounters::PerZoneCounterType type)
+CountersImpl::inc(const std::string& zone,
+ const Counters::PerZoneCounterType type)
{
per_zone_counter_[zone].inc(type);
}
isc::data::ConstElementPtr
-AuthCountersImpl::getStatistics() const {
+CountersImpl::getStatistics() const {
std::stringstream statistics_string;
statistics_string << "{ \"queries.udp\": "
- << server_counter_.get(AuthCounters::SERVER_UDP_QUERY)
+ << server_counter_.get(Counters::SERVER_UDP_QUERY)
<< ", \"queries.tcp\": "
- << server_counter_.get(AuthCounters::SERVER_TCP_QUERY);
+ << server_counter_.get(Counters::SERVER_TCP_QUERY);
// Insert non 0 Opcode counters.
for (int i = 0; i < NUM_OPCODES; ++i) {
const Counter::Type counter = opcode_counter_.get(i);
}
void
-AuthCountersImpl::registerStatisticsValidator
- (AuthCounters::validator_type validator)
+CountersImpl::registerStatisticsValidator
+ (Counters::validator_type validator)
{
validator_ = validator;
}
// Currently for testing purpose only
uint64_t
-AuthCountersImpl::getCounter(const AuthCounters::ServerCounterType type) const {
+CountersImpl::getCounter(const Counters::ServerCounterType type) const {
return (server_counter_.get(type));
}
-AuthCounters::AuthCounters() : impl_(new AuthCountersImpl())
+Counters::Counters() : impl_(new CountersImpl())
{}
-AuthCounters::~AuthCounters() {}
+Counters::~Counters() {}
void
-AuthCounters::inc(const AuthCounters::ServerCounterType type) {
+Counters::inc(const Counters::ServerCounterType type) {
impl_->inc(type);
}
void
-AuthCounters::inc(const Opcode opcode) {
+Counters::inc(const Opcode opcode) {
impl_->inc(opcode);
}
void
-AuthCounters::inc(const Rcode rcode) {
+Counters::inc(const Rcode rcode) {
impl_->inc(rcode);
}
isc::data::ConstElementPtr
-AuthCounters::getStatistics() const {
+Counters::getStatistics() const {
return (impl_->getStatistics());
}
uint64_t
-AuthCounters::getCounter(const AuthCounters::ServerCounterType type) const {
+Counters::getCounter(const Counters::ServerCounterType type) const {
return (impl_->getCounter(type));
}
uint64_t
-AuthCounters::getCounter(const Opcode opcode) const {
+Counters::getCounter(const Opcode opcode) const {
return (impl_->getCounter(opcode));
}
uint64_t
-AuthCounters::getCounter(const Rcode rcode) const {
+Counters::getCounter(const Rcode rcode) const {
return (impl_->getCounter(rcode));
}
void
-AuthCounters::registerStatisticsValidator
- (AuthCounters::validator_type validator) const
+Counters::registerStatisticsValidator
+ (Counters::validator_type validator) const
{
return (impl_->registerStatisticsValidator(validator));
}
+
+} // namespace statistics
+} // namespace auth
+} // namespace isc
#include <stdint.h>
#include <boost/scoped_ptr.hpp>
-class AuthCountersImpl;
-
namespace isc {
namespace auth {
namespace statistics {
+class CountersImpl;
+
class QRAttributes {
/// \brief Query/Response attributes for statistics.
///
/// for statistics data collection.
///
/// This class does not have getter methods since it exposes private members
-/// to \c AuthCountersImpl directly.
-friend class AuthCountersImpl;
+/// to \c CountersImpl directly.
+friend class CountersImpl;
private:
// request attributes
int req_ip_version_; // IP version
res_is_truncated_ = false;
}
-} // namespace statistics
-} // namespace auth
-} // namespace isc
-
/// \brief Set of query counters.
///
-/// \c AuthCounters is set of query counters class. It holds query counters
+/// \c Counters is set of query counters class. It holds query counters
/// and provides an interface to increment the counter of specified type
/// (e.g. UDP query, TCP query).
///
/// construction overhead of this approach should be acceptable.
///
/// \todo Hold counters for each query types (Notify, Axfr, Ixfr, Normal)
-/// \todo Consider overhead of \c AuthCounters::inc()
-class AuthCounters {
+/// \todo Consider overhead of \c Counters::inc()
+class Counters {
private:
- boost::scoped_ptr<AuthCountersImpl> impl_;
+ boost::scoped_ptr<CountersImpl> impl_;
public:
// Enum for the type of counter
enum ServerCounterType {
/// This constructor is mostly exception free. But it may still throw
/// a standard exception if memory allocation fails inside the method.
///
- AuthCounters();
+ Counters();
/// The destructor.
///
/// This method never throws an exception.
///
- ~AuthCounters();
+ ~Counters();
/// \brief Increment the counter specified by the parameter.
///
///
/// \throw std::out_of_range \a type is unknown.
///
- /// usage: counter.inc(AuthCounters::SERVER_UDP_QUERY);
+ /// usage: counter.inc(Counters::SERVER_UDP_QUERY);
///
void inc(const ServerCounterType type);
///
isc::data::ConstElementPtr getStatistics() const;
- /// \brief Get the value of a counter in the AuthCounters.
+ /// \brief Get the value of a counter in the Counters.
///
/// This function returns a value of the counter specified by \a type.
/// This method never throws an exception.
/// \param type Type of a counter to get the value of
///
/// \return the value of the counter specified by \a type.
- uint64_t getCounter(const AuthCounters::ServerCounterType type) const;
+ uint64_t getCounter(const Counters::ServerCounterType type) const;
/// \brief Get the value of a per opcode counter.
///
validator_type;
/// \brief Register a function type of the statistics validation
- /// function for AuthCounters.
+ /// function for Counters.
///
/// This method never throws an exception.
///
/// \param validator A function type of the validation of
/// statistics specification.
///
- void registerStatisticsValidator(AuthCounters::validator_type validator) const;
+ void registerStatisticsValidator(Counters::validator_type validator) const;
};
+} // namespace statistics
+} // namespace auth
+} // namespace isc
+
#endif // __STATISTICS_H
// Local Variables:
using namespace isc::server_common::portconfig;
using isc::UnitTestUtil;
using boost::scoped_ptr;
+using isc::auth::statistics::Counters;
namespace {
const char* const CONFIG_TESTDB =
// Submit UDP normal query and check query counter
TEST_F(AuthSrvTest, queryCounterUDPNormal) {
// The counter should be initialized to 0.
- EXPECT_EQ(0, server.getCounter(AuthCounters::SERVER_UDP_QUERY));
+ EXPECT_EQ(0, server.getCounter(Counters::SERVER_UDP_QUERY));
// Create UDP message and process.
UnitTestUtil::createRequestMessage(request_message, Opcode::QUERY(),
default_qid, Name("example.com"),
server.processMessage(*io_message, *parse_message, *response_obuffer,
&dnsserv);
// After processing UDP query, the counter should be 1.
- EXPECT_EQ(1, server.getCounter(AuthCounters::SERVER_UDP_QUERY));
+ EXPECT_EQ(1, server.getCounter(Counters::SERVER_UDP_QUERY));
// The counter for opcode Query should also be one
EXPECT_EQ(1, server.getCounter(Opcode::QUERY()));
// The counter for REFUSED responses should also be one, the rest zero
// Submit TCP normal query and check query counter
TEST_F(AuthSrvTest, queryCounterTCPNormal) {
// The counter should be initialized to 0.
- EXPECT_EQ(0, server.getCounter(AuthCounters::SERVER_TCP_QUERY));
+ EXPECT_EQ(0, server.getCounter(Counters::SERVER_TCP_QUERY));
// Create TCP message and process.
UnitTestUtil::createRequestMessage(request_message, Opcode::QUERY(),
default_qid, Name("example.com"),
server.processMessage(*io_message, *parse_message, *response_obuffer,
&dnsserv);
// After processing TCP query, the counter should be 1.
- EXPECT_EQ(1, server.getCounter(AuthCounters::SERVER_TCP_QUERY));
+ EXPECT_EQ(1, server.getCounter(Counters::SERVER_TCP_QUERY));
// The counter for SUCCESS responses should also be one
EXPECT_EQ(1, server.getCounter(Opcode::QUERY()));
// The counter for REFUSED responses should also be one, the rest zero
// Submit TCP AXFR query and check query counter
TEST_F(AuthSrvTest, queryCounterTCPAXFR) {
// The counter should be initialized to 0.
- EXPECT_EQ(0, server.getCounter(AuthCounters::SERVER_TCP_QUERY));
+ EXPECT_EQ(0, server.getCounter(Counters::SERVER_TCP_QUERY));
UnitTestUtil::createRequestMessage(request_message, opcode, default_qid,
Name("example.com"), RRClass::IN(), RRType::AXFR());
createRequestPacket(request_message, IPPROTO_TCP);
&dnsserv);
EXPECT_FALSE(dnsserv.hasAnswer());
// After processing TCP AXFR query, the counter should be 1.
- EXPECT_EQ(1, server.getCounter(AuthCounters::SERVER_TCP_QUERY));
+ EXPECT_EQ(1, server.getCounter(Counters::SERVER_TCP_QUERY));
// No rcodes should be incremented
checkAllRcodeCountersZero();
}
// Submit TCP IXFR query and check query counter
TEST_F(AuthSrvTest, queryCounterTCPIXFR) {
// The counter should be initialized to 0.
- EXPECT_EQ(0, server.getCounter(AuthCounters::SERVER_TCP_QUERY));
+ EXPECT_EQ(0, server.getCounter(Counters::SERVER_TCP_QUERY));
UnitTestUtil::createRequestMessage(request_message, opcode, default_qid,
Name("example.com"), RRClass::IN(), RRType::IXFR());
createRequestPacket(request_message, IPPROTO_TCP);
&dnsserv);
EXPECT_FALSE(dnsserv.hasAnswer());
// After processing TCP IXFR query, the counter should be 1.
- EXPECT_EQ(1, server.getCounter(AuthCounters::SERVER_TCP_QUERY));
+ EXPECT_EQ(1, server.getCounter(Counters::SERVER_TCP_QUERY));
}
TEST_F(AuthSrvTest, queryCounterOpcodes) {
using namespace isc::cc;
using namespace isc::dns;
using namespace isc::data;
+using isc::auth::statistics::Counters;
namespace {
-class AuthCountersTest : public ::testing::Test {
+class CountersTest : public ::testing::Test {
private:
class MockSession : public AbstractSession {
public:
};
protected:
- AuthCountersTest() : counters() {
+ CountersTest() : counters() {
}
- ~AuthCountersTest() {
+ ~CountersTest() {
}
- AuthCounters counters;
+ Counters counters;
// no need to be inherited from the original class here.
class MockModuleSpec {
public:
};
void
-AuthCountersTest::MockSession::establish(const char*) {}
+CountersTest::MockSession::establish(const char*) {}
void
-AuthCountersTest::MockSession::disconnect() {}
+CountersTest::MockSession::disconnect() {}
void
-AuthCountersTest::MockSession::subscribe(string, string)
+CountersTest::MockSession::subscribe(string, string)
{}
void
-AuthCountersTest::MockSession::unsubscribe(string, string)
+CountersTest::MockSession::unsubscribe(string, string)
{}
void
-AuthCountersTest::MockSession::startRead(boost::function<void()>)
+CountersTest::MockSession::startRead(boost::function<void()>)
{}
int
-AuthCountersTest::MockSession::reply(ConstElementPtr, ConstElementPtr) {
+CountersTest::MockSession::reply(ConstElementPtr, ConstElementPtr) {
return (-1);
}
bool
-AuthCountersTest::MockSession::hasQueuedMsgs() const {
+CountersTest::MockSession::hasQueuedMsgs() const {
return (false);
}
int
-AuthCountersTest::MockSession::group_sendmsg(ConstElementPtr msg,
+CountersTest::MockSession::group_sendmsg(ConstElementPtr msg,
string group, string, string)
{
if (throw_session_error_) {
}
bool
-AuthCountersTest::MockSession::group_recvmsg(ConstElementPtr&,
+CountersTest::MockSession::group_recvmsg(ConstElementPtr&,
ConstElementPtr& msg, bool, int)
{
if (throw_session_timeout_) {
}
void
-AuthCountersTest::MockSession::setThrowSessionError(bool flag) {
+CountersTest::MockSession::setThrowSessionError(bool flag) {
throw_session_error_ = flag;
}
void
-AuthCountersTest::MockSession::setThrowSessionTimeout(bool flag) {
+CountersTest::MockSession::setThrowSessionTimeout(bool flag) {
throw_session_timeout_ = flag;
}
-TEST_F(AuthCountersTest, incrementUDPCounter) {
+TEST_F(CountersTest, incrementUDPCounter) {
// The counter should be initialized to 0.
- EXPECT_EQ(0, counters.getCounter(AuthCounters::SERVER_UDP_QUERY));
- EXPECT_NO_THROW(counters.inc(AuthCounters::SERVER_UDP_QUERY));
+ EXPECT_EQ(0, counters.getCounter(Counters::SERVER_UDP_QUERY));
+ EXPECT_NO_THROW(counters.inc(Counters::SERVER_UDP_QUERY));
// After increment, the counter should be 1.
- EXPECT_EQ(1, counters.getCounter(AuthCounters::SERVER_UDP_QUERY));
+ EXPECT_EQ(1, counters.getCounter(Counters::SERVER_UDP_QUERY));
}
-TEST_F(AuthCountersTest, incrementTCPCounter) {
+TEST_F(CountersTest, incrementTCPCounter) {
// The counter should be initialized to 0.
- EXPECT_EQ(0, counters.getCounter(AuthCounters::SERVER_TCP_QUERY));
- EXPECT_NO_THROW(counters.inc(AuthCounters::SERVER_TCP_QUERY));
+ EXPECT_EQ(0, counters.getCounter(Counters::SERVER_TCP_QUERY));
+ EXPECT_NO_THROW(counters.inc(Counters::SERVER_TCP_QUERY));
// After increment, the counter should be 1.
- EXPECT_EQ(1, counters.getCounter(AuthCounters::SERVER_TCP_QUERY));
+ EXPECT_EQ(1, counters.getCounter(Counters::SERVER_TCP_QUERY));
}
-TEST_F(AuthCountersTest, incrementInvalidCounter) {
+TEST_F(CountersTest, incrementInvalidCounter) {
// Expect to throw an isc::OutOfRange
- EXPECT_THROW(counters.inc(AuthCounters::SERVER_COUNTER_TYPES),
+ EXPECT_THROW(counters.inc(Counters::SERVER_COUNTER_TYPES),
isc::OutOfRange);
}
-TEST_F(AuthCountersTest, incrementOpcodeCounter) {
+TEST_F(CountersTest, incrementOpcodeCounter) {
// The counter should be initialized to 0. If we increment it by 1
// the counter should be 1.
for (int i = 0; i < 16; ++i) {
}
}
-TEST_F(AuthCountersTest, incrementRcodeCounter) {
+TEST_F(CountersTest, incrementRcodeCounter) {
// The counter should be initialized to 0. If we increment it by 1
// the counter should be 1.
for (int i = 0; i < 17; ++i) {
ASSERT_EQ(static_cast<const char*>(NULL), item_names[i]);
}
-TEST_F(AuthCountersTest, getStatisticsWithoutValidator) {
+TEST_F(CountersTest, getStatisticsWithoutValidator) {
// Get statistics data.
// Validate if it answers correct data.
// Counters should be initialized to 0.
- EXPECT_EQ(0, counters.getCounter(AuthCounters::SERVER_UDP_QUERY));
- EXPECT_EQ(0, counters.getCounter(AuthCounters::SERVER_TCP_QUERY));
+ EXPECT_EQ(0, counters.getCounter(Counters::SERVER_UDP_QUERY));
+ EXPECT_EQ(0, counters.getCounter(Counters::SERVER_TCP_QUERY));
// UDP query counter is set to 2.
- counters.inc(AuthCounters::SERVER_UDP_QUERY);
- counters.inc(AuthCounters::SERVER_UDP_QUERY);
+ counters.inc(Counters::SERVER_UDP_QUERY);
+ counters.inc(Counters::SERVER_UDP_QUERY);
// TCP query counter is set to 1.
- counters.inc(AuthCounters::SERVER_TCP_QUERY);
+ counters.inc(Counters::SERVER_TCP_QUERY);
ConstElementPtr statistics_data = counters.getStatistics();
// UDP query counter is 2 and TCP query counter is 1.
}
void
-updateOpcodeCounters(AuthCounters &counters, const int expected[16]) {
+updateOpcodeCounters(Counters &counters, const int expected[16]) {
for (int i = 0; i < 16; ++i) {
for (int j = 0; j < expected[i]; ++j) {
counters.inc(Opcode(i));
}
void
-updateRcodeCounters(AuthCounters &counters, const int expected[17]) {
+updateRcodeCounters(Counters &counters, const int expected[17]) {
for (int i = 0; i < 17; ++i) {
for (int j = 0; j < expected[i]; ++j) {
counters.inc(Rcode(i));
}
}
-TEST_F(AuthCountersTest, getStatisticsWithOpcodeCounters) {
+TEST_F(CountersTest, getStatisticsWithOpcodeCounters) {
// Increment some of the opcode counters. Then they should appear in the
// submitted data; others shouldn't
const int opcode_results[16] = { 1, 2, 3, 0, 4, 5, 0, 0,
opcodeDataCheck(statistics_data, opcode_results);
}
-TEST_F(AuthCountersTest, getStatisticsWithAllOpcodeCounters) {
+TEST_F(CountersTest, getStatisticsWithAllOpcodeCounters) {
// Increment all opcode counters. Then they should appear in the
// submitted data.
const int opcode_results[16] = { 1, 1, 1, 1, 1, 1, 1, 1,
opcodeDataCheck(statistics_data, opcode_results);
}
-TEST_F(AuthCountersTest, getStatisticsWithRcodeCounters) {
+TEST_F(CountersTest, getStatisticsWithRcodeCounters) {
// Increment some of the rcode counters. Then they should appear in the
// submitted data; others shouldn't
const int rcode_results[17] = { 1, 2, 3, 4, 5, 6, 7, 8, 9,
rcodeDataCheck(statistics_data, rcode_results);
}
-TEST_F(AuthCountersTest, getStatisticsWithAllRcodeCounters) {
+TEST_F(CountersTest, getStatisticsWithAllRcodeCounters) {
// Increment all rcode counters. Then they should appear in the
// submitted data.
const int rcode_results[17] = { 1, 1, 1, 1, 1, 1, 1, 1, 1,
opcodeDataCheck(statistics_data, rcode_results);
}
-TEST_F(AuthCountersTest, getStatisticsWithValidator) {
+TEST_F(CountersTest, getStatisticsWithValidator) {
//a validator for the unittest
- AuthCounters::validator_type validator;
+ Counters::validator_type validator;
ConstElementPtr el;
// Get statistics data with correct statistics validator.
validator = boost::bind(
- &AuthCountersTest::MockModuleSpec::validateStatistics,
+ &CountersTest::MockModuleSpec::validateStatistics,
&module_spec_, _1, true);
EXPECT_TRUE(validator(el));
- // register validator to AuthCounters
+ // register validator to Counters
counters.registerStatisticsValidator(validator);
// Counters should be initialized to 0.
- EXPECT_EQ(0, counters.getCounter(AuthCounters::SERVER_UDP_QUERY));
- EXPECT_EQ(0, counters.getCounter(AuthCounters::SERVER_TCP_QUERY));
+ EXPECT_EQ(0, counters.getCounter(Counters::SERVER_UDP_QUERY));
+ EXPECT_EQ(0, counters.getCounter(Counters::SERVER_TCP_QUERY));
// UDP query counter is set to 2.
- counters.inc(AuthCounters::SERVER_UDP_QUERY);
- counters.inc(AuthCounters::SERVER_UDP_QUERY);
+ counters.inc(Counters::SERVER_UDP_QUERY);
+ counters.inc(Counters::SERVER_UDP_QUERY);
// TCP query counter is set to 1.
- counters.inc(AuthCounters::SERVER_TCP_QUERY);
+ counters.inc(Counters::SERVER_TCP_QUERY);
// checks the value returned by getStatistics
ConstElementPtr statistics_data = counters.getStatistics();
// Get statistics data with incorrect statistics validator.
validator = boost::bind(
- &AuthCountersTest::MockModuleSpec::validateStatistics,
+ &CountersTest::MockModuleSpec::validateStatistics,
&module_spec_, _1, false);
EXPECT_FALSE(validator(el));