run_benchmarks_LDFLAGS += $(CQL_LIBS)
endif
-run_benchmarks_LDADD = $(top_builddir)/src/lib/dhcpsrv/testutils/libdhcpsrvtest.la
-run_benchmarks_LDADD += $(top_builddir)/src/lib/asiolink/libkea-asiolink.la
+run_benchmarks_LDADD = $(top_builddir)/src/lib/asiolink/libkea-asiolink.la
run_benchmarks_LDADD += $(top_builddir)/src/lib/dhcp/libkea-dhcp++.la
run_benchmarks_LDADD += $(top_builddir)/src/lib/dhcpsrv/libkea-dhcpsrv.la
+run_benchmarks_LDADD += $(top_builddir)/src/lib/dhcpsrv/testutils/libdhcpsrvtest.la
run_benchmarks_LDADD += $(BENCHMARK_LDADD)
run_benchmarks_LDADD += $(LOG4CPLUS_LIBS)
run_benchmarks_LDADD += $(CRYPTO_LIBS)
run_benchmarks_LDADD += $(BOOST_LIBS)
run_benchmarks_LDADD += $(GTEST_LDADD)
+
+if HAVE_MYSQL
+run_benchmarks_LDADD += $(top_builddir)/src/lib/mysql/testutils/libmysqltest.la
+endif
+
+if HAVE_PGSQL
+run_benchmarks_LDADD += $(top_builddir)/src/lib/pgsql/testutils/libpgsqltest.la
+endif
+
+if HAVE_CQL
+run_benchmarks_LDADD += $(top_builddir)/src/lib/cql/testutils/libcqltest.la
+endif
+
endif
noinst_PROGRAMS = $(BENCHMARKS)
#include <config.h>
+#include <cql/testutils/cql_schema.h>
+
#include <dhcpsrv/benchmarks/generic_host_data_source_benchmark.h>
#include <dhcpsrv/benchmarks/parameters.h>
#include <dhcpsrv/host_data_source_factory.h>
-#include <dhcpsrv/testutils/cql_schema.h>
+#include <dhcpsrv/host_mgr.h>
+
#include <iostream>
-using namespace isc::dhcp::bench;
-using namespace isc::dhcp::test;
+using namespace isc::db::test;
using namespace isc::dhcp;
+using namespace isc::dhcp::bench;
using namespace std;
namespace {
/// @brief This is a fixture class used for benchmarking Cassandra host backend
-class CqlHostDataSourceBenchmark : public GenericHostDataSourceBenchmark {
-public:
-
+struct CqlHostDataSourceBenchmark : public GenericHostDataSourceBenchmark {
/// @brief Setup routine.
///
/// It cleans up schema and recreates tables, then instantiates HostMgr
// Ensure we have the proper schema with no transient data.
createCqlSchema();
try {
- HostDataSourceFactory::destroy();
- HostDataSourceFactory::create(validCqlConnectionString());
+ HostMgr::delBackend("cql");
+ HostMgr::addBackend(validCqlConnectionString());
} catch (...) {
cerr << "ERROR: unable to open database" << endl;
throw;
}
- hdsptr_ = HostDataSourceFactory::getHostDataSourcePtr();
+ hdsptr_ = HostMgr::instance().getHostDataSource();
+ }
+
+ void SetUp(::benchmark::State& s) override {
+ ::benchmark::State const& cs = s;
+ SetUp(cs);
}
/// @brief Cleans up after the test.
" is opened in read-only mode, continuing..."
<< endl;
}
- HostDataSourceFactory::destroy();
+ HostMgr::delBackend("cql");
// If data wipe enabled, delete transient data otherwise destroy the schema
destroyCqlSchema();
}
+
+ void TearDown(::benchmark::State& s) override {
+ ::benchmark::State const& cs = s;
+ TearDown(cs);
+ }
};
/// Defines steps necessary for conducting a benchmark that measures
}
}
-/// Defines steps necessary for conducting a benchmark that measures
-/// hosts retrieval by getAll(hw-addr, duid) call.
-BENCHMARK_DEFINE_F(CqlHostDataSourceBenchmark, getAllByHWAddrDuid)(benchmark::State& state) {
- const size_t host_count = state.range(0);
- while (state.KeepRunning()) {
- setUpWithInserts(state, host_count);
- benchGetAllByHWAddrDuid();
- }
-}
-
/// Defines steps necessary for conducting a benchmark that measures
/// hosts retrieval by getAll4(hw-addr, duid) call.
BENCHMARK_DEFINE_F(CqlHostDataSourceBenchmark, getAll)(benchmark::State& state) {
}
}
-/// Defines steps necessary for conducting a benchmark that measures
-/// hosts retrieval by get4(subnet-id, hw-addr, duid) call.
-BENCHMARK_DEFINE_F(CqlHostDataSourceBenchmark, get4BySubnetHWAddrDuid)(benchmark::State& state) {
- const size_t host_count = state.range(0);
- while (state.KeepRunning()) {
- setUpWithInserts(state, host_count);
- benchGet4BySubnetHWAddrDuid();
- }
-}
-
/// Defines steps necessary for conducting a benchmark that measures
/// hosts retrieval by get4(identifier-type, identifier, subnet-id) call.
BENCHMARK_DEFINE_F(CqlHostDataSourceBenchmark, get4IdentifierSubnetId)(benchmark::State& state) {
}
}
-/// Defines steps necessary for conducting a benchmark that measures
-/// hosts retrieval by get6(subnet-id, duid, hw-addr) call.
-BENCHMARK_DEFINE_F(CqlHostDataSourceBenchmark, get6SubnetIdDuidHWAddr)(benchmark::State& state) {
- const size_t host_count = state.range(0);
- while (state.KeepRunning()) {
- setUpWithInserts(state, host_count);
- benchGet6SubnetIdDuidHWAddr();
- }
-}
-
/// Defines steps necessary for conducting a benchmark that measures
/// hosts retrieval by get6(subnet-id, identifier-type, identifier) call.
BENCHMARK_DEFINE_F(CqlHostDataSourceBenchmark, get6IdentifierSubnetId)(benchmark::State& state) {
/// Defines parameters necessary for running a benchmark that measures
/// hosts insertion.
BENCHMARK_REGISTER_F(CqlHostDataSourceBenchmark, insertHosts)
- ->Range(MIN_HOST_COUNT, MAX_HOST_COUNT)->Unit(UNIT);
+ ->Range(MIN_HOST_COUNT, MAX_HOST_COUNT)
+ ->Unit(UNIT);
/// Defines parameters necessary for running a benchmark that measures
/// hosts update.
BENCHMARK_REGISTER_F(CqlHostDataSourceBenchmark, updateHosts)
- ->Range(MIN_HOST_COUNT, MAX_HOST_COUNT)->Unit(UNIT);
-
-/// Defines parameters necessary for running a benchmark that measures
-/// hosts retrieval by getAll(hw-addr, duid) call.
-BENCHMARK_REGISTER_F(CqlHostDataSourceBenchmark, getAllByHWAddrDuid)
- ->Range(MIN_HOST_COUNT, MAX_HOST_COUNT)->Unit(UNIT);
+ ->Range(MIN_HOST_COUNT, MAX_HOST_COUNT)
+ ->Unit(UNIT);
/// Defines parameters necessary for running a benchmark that measures
/// hosts retrieval by getAll4(hw-addr, duid) call.
BENCHMARK_REGISTER_F(CqlHostDataSourceBenchmark, getAll)
- ->Range(MIN_HOST_COUNT, MAX_HOST_COUNT)->Unit(UNIT);
+ ->Range(MIN_HOST_COUNT, MAX_HOST_COUNT)
+ ->Unit(UNIT);
/// Defines parameters necessary for running a benchmark that measures
/// hosts retrieval by getAll(v4-reservation) call.
BENCHMARK_REGISTER_F(CqlHostDataSourceBenchmark, getAllv4Resv)
- ->Range(MIN_HOST_COUNT, MAX_HOST_COUNT)->Unit(UNIT);
-
-/// Defines parameters necessary for running a benchmark that measures
-/// hosts retrieval by get4(subnet-id, hw-addr, duid) call.
-BENCHMARK_REGISTER_F(CqlHostDataSourceBenchmark, get4BySubnetHWAddrDuid)
- ->Range(MIN_HOST_COUNT, MAX_HOST_COUNT)->Unit(UNIT);
+ ->Range(MIN_HOST_COUNT, MAX_HOST_COUNT)
+ ->Unit(UNIT);
/// Defines parameters necessary for running a benchmark that measures
/// hosts retrieval by get4(identifier-type, identifier, subnet-id) call.
BENCHMARK_REGISTER_F(CqlHostDataSourceBenchmark, get4IdentifierSubnetId)
- ->Range(MIN_HOST_COUNT, MAX_HOST_COUNT)->Unit(UNIT);
+ ->Range(MIN_HOST_COUNT, MAX_HOST_COUNT)
+ ->Unit(UNIT);
/// Defines parameters necessary for running a benchmark that measures
/// hosts retrieval by get4(subnet-id, v4-reservation) call.
BENCHMARK_REGISTER_F(CqlHostDataSourceBenchmark, get4SubnetIdv4Resrv)
- ->Range(MIN_HOST_COUNT, MAX_HOST_COUNT)->Unit(UNIT);
-
-/// Defines parameters necessary for running a benchmark that measures
-/// hosts retrieval by get6(subnet-id, duid, hw-addr) call.
-BENCHMARK_REGISTER_F(CqlHostDataSourceBenchmark, get6SubnetIdDuidHWAddr)
- ->Range(MIN_HOST_COUNT, MAX_HOST_COUNT)->Unit(UNIT);
+ ->Range(MIN_HOST_COUNT, MAX_HOST_COUNT)
+ ->Unit(UNIT);
/// Defines parameters necessary for running a benchmark that measures
/// hosts retrieval by get6(subnet-id, identifier-type, identifier) call.
BENCHMARK_REGISTER_F(CqlHostDataSourceBenchmark, get6IdentifierSubnetId)
- ->Range(MIN_HOST_COUNT, MAX_HOST_COUNT)->Unit(UNIT);
+ ->Range(MIN_HOST_COUNT, MAX_HOST_COUNT)
+ ->Unit(UNIT);
/// Defines parameters necessary for running a benchmark that measures
/// hosts retrieval by get6(subnet-id, ip-address) call.
BENCHMARK_REGISTER_F(CqlHostDataSourceBenchmark, get6SubnetIdAddr)
- ->Range(MIN_HOST_COUNT, MAX_HOST_COUNT)->Unit(UNIT);
+ ->Range(MIN_HOST_COUNT, MAX_HOST_COUNT)
+ ->Unit(UNIT);
/// Defines parameters necessary for running a benchmark that measures
/// hosts retrieval by get6(ip-prefix, prefix-len) call.
BENCHMARK_REGISTER_F(CqlHostDataSourceBenchmark, get6Prefix)
- ->Range(MIN_HOST_COUNT, MAX_HOST_COUNT)->Unit(UNIT);
+ ->Range(MIN_HOST_COUNT, MAX_HOST_COUNT)
+ ->Unit(UNIT);
} // namespace
#include <config.h>
+#include <cql/testutils/cql_schema.h>
+
#include <dhcpsrv/benchmarks/generic_lease_mgr_benchmark.h>
#include <dhcpsrv/benchmarks/parameters.h>
#include <dhcpsrv/lease_mgr_factory.h>
-#include <dhcpsrv/testutils/cql_schema.h>
+using namespace isc::db::test;
using namespace isc::dhcp::bench;
-using namespace isc::dhcp::test;
using namespace isc::dhcp;
using namespace std;
namespace {
/// @brief This is a fixture class used for benchmarking Cassandra lease backend
-class CqlLeaseMgrBenchmark : public GenericLeaseMgrBenchmark {
-public:
+struct CqlLeaseMgrBenchmark : public GenericLeaseMgrBenchmark {
/// @brief Setup routine.
///
/// It cleans up schema and recreates tables, then instantiates LeaseMgr
lmptr_ = &(LeaseMgrFactory::instance());
}
+ void SetUp(::benchmark::State& s) override {
+ ::benchmark::State const& cs = s;
+ SetUp(cs);
+ }
+
/// @brief Cleans up after the test.
void TearDown(::benchmark::State const&) override {
try {
// If data wipe enabled, delete transient data otherwise destroy the schema
destroyCqlSchema();
}
+
+ void TearDown(::benchmark::State& s) override {
+ ::benchmark::State const& cs = s;
+ TearDown(cs);
+ }
+
+
};
// Defines a benchmark that measures IPv4 leases insertion.
// Defines a benchmark that measures IPv6 leases retrieval by lease type, duid, iaid
// and subnet-id.
BENCHMARK_DEFINE_F(CqlLeaseMgrBenchmark, getLease6_type_duid_iaid_subnetid)
- (benchmark::State& state) {
+(benchmark::State& state) {
const size_t lease_count = state.range(0);
while (state.KeepRunning()) {
setUpWithInserts6(state, lease_count);
}
}
-
/// The following macros define run parameters for previously defined
/// Cassandra benchmarks.
/// A benchmark that measures IPv4 leases insertion.
BENCHMARK_REGISTER_F(CqlLeaseMgrBenchmark, insertLeases4)
- ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)->Unit(UNIT);
+ ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)
+ ->Unit(UNIT);
/// A benchmark that measures IPv4 leases update.
BENCHMARK_REGISTER_F(CqlLeaseMgrBenchmark, updateLeases4)
- ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)->Unit(UNIT);
+ ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)
+ ->Unit(UNIT);
/// A benchmark that measures IPv4 lease retrieval by IP address.
BENCHMARK_REGISTER_F(CqlLeaseMgrBenchmark, getLease4_address)
- ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)->Unit(UNIT);
+ ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)
+ ->Unit(UNIT);
/// A benchmark that measures IPv4 lease retrieval by hardware address.
BENCHMARK_REGISTER_F(CqlLeaseMgrBenchmark, getLease4_hwaddr)
- ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)->Unit(UNIT);
+ ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)
+ ->Unit(UNIT);
/// A benchmark that measures IPv4 lease retrieval by hardware address and a
/// subnet-id.
BENCHMARK_REGISTER_F(CqlLeaseMgrBenchmark, getLease4_hwaddr_subnetid)
- ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)->Unit(UNIT);
+ ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)
+ ->Unit(UNIT);
/// A benchmark that measures IPv4 lease retrieval by client-id.
BENCHMARK_REGISTER_F(CqlLeaseMgrBenchmark, getLease4_clientid)
- ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)->Unit(UNIT);
+ ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)
+ ->Unit(UNIT);
/// A benchmark that measures IPv4 lease retrieval by client-id and subnet-id.
BENCHMARK_REGISTER_F(CqlLeaseMgrBenchmark, getLease4_clientid_subnetid)
- ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)->Unit(UNIT);
+ ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)
+ ->Unit(UNIT);
/// A benchmark that measures expired IPv4 leases retrieval.
BENCHMARK_REGISTER_F(CqlLeaseMgrBenchmark, getExpiredLeases4)
- ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)->Unit(UNIT);
+ ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)
+ ->Unit(UNIT);
/// A benchmark that measures IPv6 leases insertion.
BENCHMARK_REGISTER_F(CqlLeaseMgrBenchmark, insertLeases6)
- ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)->Unit(UNIT);
+ ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)
+ ->Unit(UNIT);
/// A benchmark that measures IPv6 leases update.
BENCHMARK_REGISTER_F(CqlLeaseMgrBenchmark, updateLeases6)
- ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)->Unit(UNIT);
+ ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)
+ ->Unit(UNIT);
/// A benchmark that measures IPv6 lease retrieval by lease type and IP address.
BENCHMARK_REGISTER_F(CqlLeaseMgrBenchmark, getLease6_type_address)
- ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)->Unit(UNIT);
+ ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)
+ ->Unit(UNIT);
/// A benchmark that measures IPv6 lease retrieval by lease type, duid and iaid.
BENCHMARK_REGISTER_F(CqlLeaseMgrBenchmark, getLease6_type_duid_iaid)
- ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)->Unit(UNIT);
+ ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)
+ ->Unit(UNIT);
/// A benchmark that measures IPv6 lease retrieval by lease type, duid, iaid and
/// subnet-id.
BENCHMARK_REGISTER_F(CqlLeaseMgrBenchmark, getLease6_type_duid_iaid_subnetid)
- ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)->Unit(UNIT);
+ ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)
+ ->Unit(UNIT);
/// A benchmark that measures expired IPv6 leases retrieval.
BENCHMARK_REGISTER_F(CqlLeaseMgrBenchmark, getExpiredLeases6)
- ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)->Unit(UNIT);
+ ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)
+ ->Unit(UNIT);
} // namespace
#include <config.h>
-#include <dhcpsrv/benchmarks/generic_host_data_source_benchmark.h>
-
#include <asiolink/io_address.h>
+
+#include <database/testutils/schema.h>
+
#include <dhcp/dhcp6.h>
#include <dhcp/libdhcp++.h>
#include <dhcp/option4_addrlst.h>
#include <dhcp/option_int.h>
#include <dhcp/option_string.h>
#include <dhcp/option_vendor.h>
+
+#include <dhcpsrv/benchmarks/generic_host_data_source_benchmark.h>
#include <dhcpsrv/host_data_source_factory.h>
-#include <dhcpsrv/testutils/schema.h>
#include <dhcpsrv/testutils/host_data_source_utils.h>
using isc::asiolink::IOAddress;
namespace dhcp {
namespace bench {
-GenericHostDataSourceBenchmark::GenericHostDataSourceBenchmark()
- : hdsptr_() {
+GenericHostDataSourceBenchmark::GenericHostDataSourceBenchmark() : hdsptr_() {
LibDHCP::clearRuntimeOptionDefs();
}
}
void
-GenericHostDataSourceBenchmark::setUp(::benchmark::State& state,
- size_t const& host_count) {
+GenericHostDataSourceBenchmark::setUp(::benchmark::State& state, size_t const& host_count) {
state.PauseTiming();
SetUp(state);
prepareHosts(host_count);
}
void
-GenericHostDataSourceBenchmark::addTestOptions(const HostPtr& host, const bool formatted,
+GenericHostDataSourceBenchmark::addTestOptions(const HostPtr& host,
+ const bool formatted,
const AddedOptions& added_options) const {
OptionDefSpaceContainer defs;
// Add DHCPv4 options.
CfgOptionPtr opts = host->getCfgOption4();
opts->add(createOption<OptionString>(Option::V4, DHO_BOOT_FILE_NAME, true, formatted,
- "my-boot-file"), DHCP4_OPTION_SPACE);
- opts->add(createOption<OptionUint8>(Option::V4, DHO_DEFAULT_IP_TTL,
- false, formatted, 64), DHCP4_OPTION_SPACE);
+ "my-boot-file"),
+ DHCP4_OPTION_SPACE);
+ opts->add(createOption<OptionUint8>(Option::V4, DHO_DEFAULT_IP_TTL, false, formatted, 64),
+ DHCP4_OPTION_SPACE);
opts->add(createOption<OptionUint32>(Option::V4, 1, false, formatted, 312131),
"vendor-encapsulated-options");
opts->add(createAddressOption<Option4AddrLst>(254, false, formatted, "192.0.2.3"),
DHCP4_OPTION_SPACE);
opts->add(createEmptyOption(Option::V4, 1, true), "isc");
- opts->add(createAddressOption<Option4AddrLst>(2, false, formatted, "10.0.0.5",
- "10.0.0.3", "10.0.3.4"), "isc");
+ opts->add(createAddressOption<Option4AddrLst>(2, false, formatted, "10.0.0.5", "10.0.0.3",
+ "10.0.3.4"),
+ "isc");
// Add definitions for DHCPv4 non-standard options.
- defs.addItem(OptionDefinitionPtr(new OptionDefinition("vendor-encapsulated-1", 1,
- "uint32")), "vendor-encapsulated-options");
- defs.addItem(OptionDefinitionPtr(new OptionDefinition("option-254", 254, "ipv4-address",
- true)), DHCP4_OPTION_SPACE);
+ defs.addItem(
+ OptionDefinitionPtr(new OptionDefinition("vendor-encapsulated-1", 1, "uint32")),
+ "vendor-encapsulated-options");
+ defs.addItem(
+ OptionDefinitionPtr(new OptionDefinition("option-254", 254, "ipv4-address", true)),
+ DHCP4_OPTION_SPACE);
defs.addItem(OptionDefinitionPtr(new OptionDefinition("isc-1", 1, "empty")), "isc");
defs.addItem(OptionDefinitionPtr(new OptionDefinition("isc-2", 2, "ipv4-address", true)),
"isc");
if ((added_options == DHCP6_ONLY) || (added_options == DHCP4_AND_DHCP6)) {
// Add DHCPv6 options.
CfgOptionPtr opts = host->getCfgOption6();
- opts->add(createOption<OptionString>(Option::V6, D6O_BOOTFILE_URL, true,
- formatted, "my-boot-file"), DHCP6_OPTION_SPACE);
- opts->add(createOption<OptionUint32>(Option::V6, D6O_INFORMATION_REFRESH_TIME,
- false, formatted, 3600), DHCP6_OPTION_SPACE);
+ opts->add(createOption<OptionString>(Option::V6, D6O_BOOTFILE_URL, true, formatted,
+ "my-boot-file"),
+ DHCP6_OPTION_SPACE);
+ opts->add(createOption<OptionUint32>(Option::V6, D6O_INFORMATION_REFRESH_TIME, false,
+ formatted, 3600),
+ DHCP6_OPTION_SPACE);
opts->add(createVendorOption(Option::V6, false, formatted, 2495), DHCP6_OPTION_SPACE);
opts->add(createAddressOption<Option6AddrLst>(1024, false, formatted, "2001:db8:1::1"),
DHCP6_OPTION_SPACE);
opts->add(createEmptyOption(Option::V6, 1, true), "isc2");
opts->add(createAddressOption<Option6AddrLst>(2, false, formatted, "3000::1", "3000::2",
- "3000::3"), "isc2");
+ "3000::3"),
+ "isc2");
// Add definitions for DHCPv6 non-standard options.
- defs.addItem(OptionDefinitionPtr(new OptionDefinition("option-1024", 1024, "ipv6-address",
- true)), DHCP6_OPTION_SPACE);
+ defs.addItem(
+ OptionDefinitionPtr(new OptionDefinition("option-1024", 1024, "ipv6-address", true)),
+ DHCP6_OPTION_SPACE);
defs.addItem(OptionDefinitionPtr(new OptionDefinition("option-1", 1, "empty")), "isc2");
- defs.addItem(OptionDefinitionPtr(new OptionDefinition("option-2", 2, "ipv6-address",
- true)), "isc2");
+ defs.addItem(OptionDefinitionPtr(new OptionDefinition("option-2", 2, "ipv6-address", true)),
+ "isc2");
}
// Register created "runtime" option definitions. They will be used by a
}
}
-void
-GenericHostDataSourceBenchmark::benchGetAllByHWAddrDuid() {
- for (HostPtr host : hosts_) {
- ConstHostCollection from_hds =
- hdsptr_->getAll(host->getHWAddress(), host->getDuid());
- }
-}
-
void
GenericHostDataSourceBenchmark::benchGetAll() {
for (HostPtr host : hosts_) {
}
}
-void
-GenericHostDataSourceBenchmark::benchGet4BySubnetHWAddrDuid() {
- for (HostPtr host : hosts_) {
- std::vector<uint8_t> hwaddr = host->getIdentifier();
- hdsptr_->get4(host->getIPv4SubnetID(), HWAddrPtr(new HWAddr(hwaddr,
- host->getIdentifierType())), host->getDuid());
- }
-}
-
void
GenericHostDataSourceBenchmark::benchGet4IdentifierSubnetId() {
for (HostPtr host : hosts_) {
std::vector<uint8_t> hwaddr = host->getIdentifier();
- hdsptr_->get4(host->getIPv4SubnetID(), host->getIdentifierType(),
- &hwaddr[0], hwaddr.size());
+ hdsptr_->get4(host->getIPv4SubnetID(), host->getIdentifierType(), &hwaddr[0],
+ hwaddr.size());
}
}
}
}
-void
-GenericHostDataSourceBenchmark::benchGet6SubnetIdDuidHWAddr() {
- for (HostPtr host : hosts_) {
- hdsptr_->get6(host->getIPv6SubnetID(), host->getDuid(),
- host->getHWAddress());
- }
-}
-
void
GenericHostDataSourceBenchmark::benchGet6IdentifierSubnetId() {
for (HostPtr host : hosts_) {
std::vector<uint8_t> hwaddr = host->getIdentifier();
- hdsptr_->get6(host->getIPv6SubnetID(), host->getIdentifierType(),
- &hwaddr[0], hwaddr.size());
+ hdsptr_->get6(host->getIPv6SubnetID(), host->getIdentifierType(), &hwaddr[0],
+ hwaddr.size());
}
}
GenericHostDataSourceBenchmark::benchGet6Prefix() {
for (HostPtr host : hosts_) {
const IPv6ResrvRange range = host->getIPv6Reservations();
- hdsptr_->get6(range.first->second.getPrefix(),
- range.first->second.getPrefixLen());
+ hdsptr_->get6(range.first->second.getPrefix(), range.first->second.getPrefixLen());
}
}
namespace bench {
/// @brief Base fixture class for benchmarking host backends.
-class GenericHostDataSourceBenchmark : public ::benchmark::Fixture {
-public:
-
+struct GenericHostDataSourceBenchmark : public ::benchmark::Fixture {
/// @brief Defines universe (IPv4 or IPv6)
enum Universe { V4, V6 };
/// @brief Defines what kind of options should be added for a host
enum AddedOptions {
- DHCP4_ONLY, ///< DHCPv4-only options
- DHCP6_ONLY, ///< DHCPv6-only options
+ DHCP4_ONLY, ///< DHCPv4-only options
+ DHCP6_ONLY, ///< DHCPv6-only options
DHCP4_AND_DHCP6 ///< Both DHCPv4 and DHCPv6 options
};
/// @param address3 third address to be used (optional)
/// @return the option created wrapped in an option descriptor structure
template <typename OptionType>
- OptionDescriptor
- createAddressOption(const uint16_t option_type, const bool persist,
- const bool formatted, const std::string& address1 = "",
- const std::string& address2 = "",
- const std::string& address3 = "") const {
+ OptionDescriptor createAddressOption(const uint16_t option_type,
+ const bool persist,
+ const bool formatted,
+ const std::string& address1 = "",
+ const std::string& address2 = "",
+ const std::string& address3 = "") const {
std::ostringstream s;
// First address.
/// @param host host reservation to be extended with options
/// @param formatted whether to generate text representation
/// @param added_options v4, v6 or both
- void addTestOptions(const HostPtr& host,const bool formatted,
+ void addTestOptions(const HostPtr& host,
+ const bool formatted,
const AddedOptions& added_options) const;
/// @brief Sets up timers, creates and inserts hosts.
/// @brief Updates all hosts stored in hosts_ in the benchmarked host backend
void updateHosts();
- void benchGetAllByHWAddrDuid();
-
/// @brief Essential steps required to benchmark the
/// getAll(identifier-type, identifier) call.
void benchGetAll();
/// using getAll(ipv4-reservation) call.
void getAllv4Resv();
- /// @brief Essential steps requires to benchmark host reservation retrieval
- /// using getAll(hw-addr, duid) call.
- void benchGet4BySubnetHWAddrDuid();
-
/// @brief Essential steps requires to benchmark host reservation retrieval
/// using getAll(identifier-type, identifier, subnet-id) call.
void benchGet4IdentifierSubnetId();
/// using getAll(v4-reservation) call.
void benchGet4SubnetIdv4Resrv();
- /// @brief Essential steps requires to benchmark host reservation retrieval
- /// using get6(subnet-id, duid, hw-addr) call.
- void benchGet6SubnetIdDuidHWAddr();
-
/// @brief Essential steps requires to benchmark host reservation retrieval
/// using get6(identifier-type, identifier, subnet-id) call.
void benchGet6IdentifierSubnetId();
#include <config.h>
#include <dhcpsrv/benchmarks/generic_lease_mgr_benchmark.h>
-
#include <dhcpsrv/lease_mgr_factory.h>
-#include <dhcpsrv/testutils/cql_schema.h>
#include <chrono>
#include <iomanip>
#include <vector>
using namespace isc::asiolink;
-using namespace isc::dhcp::test;
using namespace std;
using namespace std::chrono;
namespace dhcp {
namespace bench {
-GenericLeaseMgrBenchmark::GenericLeaseMgrBenchmark()
- : lmptr_(NULL) {
+GenericLeaseMgrBenchmark::GenericLeaseMgrBenchmark() : lmptr_(NULL) {
}
GenericLeaseMgrBenchmark::~GenericLeaseMgrBenchmark() {
void
GenericLeaseMgrBenchmark::benchGetLease6_type_duid_iaid_subnetid() {
for (Lease6Ptr const& lease : leases6_) {
- lmptr_->getLease6(lease->type_, *lease->duid_, lease->iaid_,
- lease->subnet_id_);
+ lmptr_->getLease6(lease->type_, *lease->duid_, lease->iaid_, lease->subnet_id_);
}
}
namespace bench {
/// @brief A base class for a fixture for specific lease manager benchmarks
-class GenericLeaseMgrBenchmark : public benchmark::Fixture {
-public:
-
+struct GenericLeaseMgrBenchmark : public benchmark::Fixture {
/// Specifies the IP protocol family to be bested.
enum Universe { V4, V6 };
#include <dhcpsrv/benchmarks/generic_lease_mgr_benchmark.h>
#include <dhcpsrv/benchmarks/parameters.h>
-#include <dhcpsrv/memfile_lease_mgr.h>
#include <dhcpsrv/lease_mgr_factory.h>
+#include <dhcpsrv/memfile_lease_mgr.h>
#include <dhcpsrv/testutils/lease_file_io.h>
using namespace isc::dhcp::bench;
namespace {
/// @brief This is a fixture class used for benchmarking Memfile lease backend
-class MemfileLeaseMgrBenchmark : public GenericLeaseMgrBenchmark {
-public:
-
+struct MemfileLeaseMgrBenchmark : public GenericLeaseMgrBenchmark {
/// @brief Constructor
///
/// Sets the files used for writing lease files.
- MemfileLeaseMgrBenchmark()
- : io4_(""), io6_("") {
+ MemfileLeaseMgrBenchmark() : io4_(""), io6_("") {
}
/// @brief Setup routine.
lmptr_ = &(LeaseMgrFactory::instance());
}
+ void SetUp(::benchmark::State& s) override {
+ ::benchmark::State const& cs = s;
+ SetUp(cs);
+ }
+
/// @brief Creates instance of the backend.
///
/// @param u Universe (v4 or V6).
LeaseMgrFactory::create(getConfigString(u));
} catch (...) {
std::cerr << "*** ERROR: unable to create instance of the Memfile\n"
- " lease database backend.\n";
+ " lease database backend.\n";
throw;
}
lmptr_ = &(LeaseMgrFactory::instance());
/// @return Configuration string for @c LeaseMgrFactory.
static std::string getConfigString(Universe u) {
std::ostringstream s;
- s << "type=memfile " << (u == V4 ? "universe=4 " : "universe=6 ") << "name="
- << getLeaseFilePath(u == V4 ? "leasefile4_0.csv" : "leasefile6_0.csv")
+ s << "type=memfile " << (u == V4 ? "universe=4 " : "universe=6 ")
+ << "name=" << getLeaseFilePath(u == V4 ? "leasefile4_0.csv" : "leasefile6_0.csv")
<< " lfc-interval=0";
return (s.str());
}
lmptr_->rollback();
} catch (...) {
std::cerr << "WARNING: rollback has failed. This is surprising as "
- "memfile doesn't support rollback." << std::endl;
+ "memfile doesn't support rollback."
+ << std::endl;
}
LeaseMgrFactory::destroy();
removeFiles(getLeaseFilePath("leasefile6_0.csv"));
}
+ void TearDown(::benchmark::State& s) override {
+ ::benchmark::State const& cs = s;
+ TearDown(cs);
+ }
+
/// @brief Object providing access to v4 lease IO.
LeaseFileIO io4_;
// Defines a benchmark that measures IPv6 leases retrieval by lease type, duid, iaid
// and subnet-id.
BENCHMARK_DEFINE_F(MemfileLeaseMgrBenchmark, getLease6_type_duid_iaid_subnetid)
- (benchmark::State& state) {
+(benchmark::State& state) {
const size_t lease_count = state.range(0);
while (state.KeepRunning()) {
setUpWithInserts6(state, lease_count);
}
}
-
/// The following macros define run parameters for previously defined
/// memfile benchmarks.
/// A benchmark that measures IPv4 leases insertion.
BENCHMARK_REGISTER_F(MemfileLeaseMgrBenchmark, insertLeases4)
- ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)->Unit(UNIT);
+ ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)
+ ->Unit(UNIT);
/// A benchmark that measures IPv4 leases update.
BENCHMARK_REGISTER_F(MemfileLeaseMgrBenchmark, updateLeases4)
- ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)->Unit(UNIT);
+ ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)
+ ->Unit(UNIT);
/// A benchmark that measures IPv4 lease retrieval by IP address.
BENCHMARK_REGISTER_F(MemfileLeaseMgrBenchmark, getLease4_address)
- ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)->Unit(UNIT);
+ ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)
+ ->Unit(UNIT);
/// A benchmark that measures IPv4 lease retrieval by hardware address.
BENCHMARK_REGISTER_F(MemfileLeaseMgrBenchmark, getLease4_hwaddr)
- ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)->Unit(UNIT);
+ ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)
+ ->Unit(UNIT);
/// A benchmark that measures IPv4 lease retrieval by hardware address and a
/// subnet-id.
BENCHMARK_REGISTER_F(MemfileLeaseMgrBenchmark, getLease4_hwaddr_subnetid)
- ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)->Unit(UNIT);
+ ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)
+ ->Unit(UNIT);
/// A benchmark that measures IPv4 lease retrieval by client-id.
BENCHMARK_REGISTER_F(MemfileLeaseMgrBenchmark, getLease4_clientid)
- ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)->Unit(UNIT);
+ ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)
+ ->Unit(UNIT);
/// A benchmark that measures IPv4 lease retrieval by client-id and subnet-id.
BENCHMARK_REGISTER_F(MemfileLeaseMgrBenchmark, getLease4_clientid_subnetid)
- ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)->Unit(UNIT);
+ ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)
+ ->Unit(UNIT);
/// A benchmark that measures expired IPv4 leases retrieval.
BENCHMARK_REGISTER_F(MemfileLeaseMgrBenchmark, getExpiredLeases4)
- ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)->Unit(UNIT);
+ ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)
+ ->Unit(UNIT);
/// A benchmark that measures IPv6 leases insertion.
BENCHMARK_REGISTER_F(MemfileLeaseMgrBenchmark, insertLeases6)
- ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)->Unit(UNIT);
+ ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)
+ ->Unit(UNIT);
/// A benchmark that measures IPv6 leases update.
BENCHMARK_REGISTER_F(MemfileLeaseMgrBenchmark, updateLeases6)
- ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)->Unit(UNIT);
+ ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)
+ ->Unit(UNIT);
/// A benchmark that measures IPv6 lease retrieval by lease type and IP address.
BENCHMARK_REGISTER_F(MemfileLeaseMgrBenchmark, getLease6_type_address)
- ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)->Unit(UNIT);
+ ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)
+ ->Unit(UNIT);
/// A benchmark that measures IPv6 lease retrieval by lease type, duid and iaid.
BENCHMARK_REGISTER_F(MemfileLeaseMgrBenchmark, getLease6_type_duid_iaid)
- ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)->Unit(UNIT);
+ ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)
+ ->Unit(UNIT);
/// A benchmark that measures IPv6 lease retrieval by lease type, duid, iaid and
/// subnet-id.
BENCHMARK_REGISTER_F(MemfileLeaseMgrBenchmark, getLease6_type_duid_iaid_subnetid)
- ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)->Unit(UNIT);
+ ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)
+ ->Unit(UNIT);
/// A benchmark that measures expired IPv6 leases retrieval.
BENCHMARK_REGISTER_F(MemfileLeaseMgrBenchmark, getExpiredLeases6)
- ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)->Unit(UNIT);
+ ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)
+ ->Unit(UNIT);
} // namespace
#include <config.h>
+#include <mysql/testutils/mysql_schema.h>
+
#include <dhcpsrv/benchmarks/generic_host_data_source_benchmark.h>
#include <dhcpsrv/benchmarks/parameters.h>
#include <dhcpsrv/host_data_source_factory.h>
-#include <dhcpsrv/testutils/mysql_schema.h>
+#include <dhcpsrv/host_mgr.h>
+
#include <iostream>
-using namespace isc::dhcp::bench;
-using namespace isc::dhcp::test;
+using namespace isc::db::test;
using namespace isc::dhcp;
+using namespace isc::dhcp::bench;
using namespace std;
namespace {
/// @brief This is a fixture class used for benchmarking MySQL host backend
-class MySqlHostDataSourceBenchmark : public GenericHostDataSourceBenchmark {
-public:
-
+struct MySqlHostDataSourceBenchmark : public GenericHostDataSourceBenchmark {
/// @brief Setup routine.
///
/// It cleans up schema and recreates tables, then instantiates HostMgr
// Ensure we have the proper schema with no transient data.
createMySQLSchema();
try {
- HostDataSourceFactory::destroy();
- HostDataSourceFactory::create(validMySQLConnectionString());
+ HostMgr::delBackend("mysql");
+ HostMgr::addBackend(validMySQLConnectionString());
} catch (...) {
cerr << "ERROR: unable to open database" << endl;
throw;
}
- hdsptr_ = HostDataSourceFactory::getHostDataSourcePtr();
+ hdsptr_ = HostMgr::instance().getHostDataSource();
+ }
+
+ void SetUp(::benchmark::State& s) override {
+ ::benchmark::State const& cs = s;
+ SetUp(cs);
}
/// @brief Cleans up after the test.
" is opened in read-only mode, continuing..."
<< endl;
}
- HostDataSourceFactory::destroy();
+ HostMgr::delBackend("mysql");
// If data wipe enabled, delete transient data otherwise destroy the schema.
destroyMySQLSchema();
}
+
+ void TearDown(::benchmark::State& s) override {
+ ::benchmark::State const& cs = s;
+ TearDown(cs);
+ }
};
/// Defines steps necessary for conducting a benchmark that measures
}
}
-/// Defines steps necessary for conducting a benchmark that measures
-/// hosts retrieval by getAll(hw-addr, duid) call.
-BENCHMARK_DEFINE_F(MySqlHostDataSourceBenchmark, getAllByHWAddrDuid)(benchmark::State& state) {
- const size_t host_count = state.range(0);
- while (state.KeepRunning()) {
- setUpWithInserts(state, host_count);
- benchGetAllByHWAddrDuid();
- }
-}
-
/// Defines steps necessary for conducting a benchmark that measures
/// hosts retrieval by getAll4(hw-addr, duid) call.
BENCHMARK_DEFINE_F(MySqlHostDataSourceBenchmark, getAll)(benchmark::State& state) {
}
}
-/// Defines steps necessary for conducting a benchmark that measures
-/// hosts retrieval by get4(subnet-id, hw-addr, duid) call.
-BENCHMARK_DEFINE_F(MySqlHostDataSourceBenchmark, get4BySubnetHWAddrDuid)(benchmark::State& state) {
- const size_t host_count = state.range(0);
- while (state.KeepRunning()) {
- setUpWithInserts(state, host_count);
- benchGet4BySubnetHWAddrDuid();
- }
-}
-
/// Defines steps necessary for conducting a benchmark that measures
/// hosts retrieval by get4(identifier-type, identifier, subnet-id) call.
BENCHMARK_DEFINE_F(MySqlHostDataSourceBenchmark, get4IdentifierSubnetId)(benchmark::State& state) {
}
}
-/// Defines steps necessary for conducting a benchmark that measures
-/// hosts retrieval by get6(subnet-id, duid, hw-addr) call.
-BENCHMARK_DEFINE_F(MySqlHostDataSourceBenchmark, get6SubnetIdDuidHWAddr)(benchmark::State& state) {
- const size_t host_count = state.range(0);
- while (state.KeepRunning()) {
- setUpWithInserts(state, host_count);
- benchGet6SubnetIdDuidHWAddr();
- }
-}
-
/// Defines steps necessary for conducting a benchmark that measures
/// hosts retrieval by get6(subnet-id, identifier-type, identifier) call.
BENCHMARK_DEFINE_F(MySqlHostDataSourceBenchmark, get6IdentifierSubnetId)(benchmark::State& state) {
/// Defines parameters necessary for running a benchmark that measures
/// hosts insertion.
BENCHMARK_REGISTER_F(MySqlHostDataSourceBenchmark, insertHosts)
- ->Range(MIN_HOST_COUNT, MAX_HOST_COUNT)->Unit(UNIT);
+ ->Range(MIN_HOST_COUNT, MAX_HOST_COUNT)
+ ->Unit(UNIT);
/// Defines parameters necessary for running a benchmark that measures
/// hosts update.
BENCHMARK_REGISTER_F(MySqlHostDataSourceBenchmark, updateHosts)
- ->Range(MIN_HOST_COUNT, MAX_HOST_COUNT)->Unit(UNIT);
-
-/// Defines parameters necessary for running a benchmark that measures
-/// hosts retrieval by getAll(hw-addr, duid) call.
-BENCHMARK_REGISTER_F(MySqlHostDataSourceBenchmark, getAllByHWAddrDuid)
- ->Range(MIN_HOST_COUNT, MAX_HOST_COUNT)->Unit(UNIT);
+ ->Range(MIN_HOST_COUNT, MAX_HOST_COUNT)
+ ->Unit(UNIT);
/// Defines parameters necessary for running a benchmark that measures
/// hosts retrieval by getAll4(hw-addr, duid) call.
BENCHMARK_REGISTER_F(MySqlHostDataSourceBenchmark, getAll)
- ->Range(MIN_HOST_COUNT, MAX_HOST_COUNT)->Unit(UNIT);
+ ->Range(MIN_HOST_COUNT, MAX_HOST_COUNT)
+ ->Unit(UNIT);
/// Defines parameters necessary for running a benchmark that measures
/// hosts retrieval by getAll(v4-reservation) call.
BENCHMARK_REGISTER_F(MySqlHostDataSourceBenchmark, getAllv4Resv)
- ->Range(MIN_HOST_COUNT, MAX_HOST_COUNT)->Unit(UNIT);
-
-/// Defines parameters necessary for running a benchmark that measures
-/// hosts retrieval by get4(subnet-id, hw-addr, duid) call.
-BENCHMARK_REGISTER_F(MySqlHostDataSourceBenchmark, get4BySubnetHWAddrDuid)
- ->Range(MIN_HOST_COUNT, MAX_HOST_COUNT)->Unit(UNIT);
+ ->Range(MIN_HOST_COUNT, MAX_HOST_COUNT)
+ ->Unit(UNIT);
/// Defines parameters necessary for running a benchmark that measures
/// hosts retrieval by get4(identifier-type, identifier, subnet-id) call.
BENCHMARK_REGISTER_F(MySqlHostDataSourceBenchmark, get4IdentifierSubnetId)
- ->Range(MIN_HOST_COUNT, MAX_HOST_COUNT)->Unit(UNIT);
+ ->Range(MIN_HOST_COUNT, MAX_HOST_COUNT)
+ ->Unit(UNIT);
/// Defines parameters necessary for running a benchmark that measures
/// hosts retrieval by get4(subnet-id, v4-reservation) call.
BENCHMARK_REGISTER_F(MySqlHostDataSourceBenchmark, get4SubnetIdv4Resrv)
- ->Range(MIN_HOST_COUNT, MAX_HOST_COUNT)->Unit(UNIT);
-
-/// Defines parameters necessary for running a benchmark that measures
-/// hosts retrieval by get6(subnet-id, duid, hw-addr) call.
-BENCHMARK_REGISTER_F(MySqlHostDataSourceBenchmark, get6SubnetIdDuidHWAddr)
- ->Range(MIN_HOST_COUNT, MAX_HOST_COUNT)->Unit(UNIT);
+ ->Range(MIN_HOST_COUNT, MAX_HOST_COUNT)
+ ->Unit(UNIT);
/// Defines parameters necessary for running a benchmark that measures
/// hosts retrieval by get6(subnet-id, identifier-type, identifier) call.
BENCHMARK_REGISTER_F(MySqlHostDataSourceBenchmark, get6IdentifierSubnetId)
- ->Range(MIN_HOST_COUNT, MAX_HOST_COUNT)->Unit(UNIT);
+ ->Range(MIN_HOST_COUNT, MAX_HOST_COUNT)
+ ->Unit(UNIT);
/// Defines parameters necessary for running a benchmark that measures
/// hosts retrieval by get6(subnet-id, ip-address) call.
BENCHMARK_REGISTER_F(MySqlHostDataSourceBenchmark, get6SubnetIdAddr)
- ->Range(MIN_HOST_COUNT, MAX_HOST_COUNT)->Unit(UNIT);
+ ->Range(MIN_HOST_COUNT, MAX_HOST_COUNT)
+ ->Unit(UNIT);
/// Defines parameters necessary for running a benchmark that measures
/// hosts retrieval by get6(ip-prefix, prefix-len) call.
BENCHMARK_REGISTER_F(MySqlHostDataSourceBenchmark, get6Prefix)
- ->Range(MIN_HOST_COUNT, MAX_HOST_COUNT)->Unit(UNIT);
+ ->Range(MIN_HOST_COUNT, MAX_HOST_COUNT)
+ ->Unit(UNIT);
} // namespace
#include <dhcpsrv/benchmarks/generic_lease_mgr_benchmark.h>
#include <dhcpsrv/benchmarks/parameters.h>
#include <dhcpsrv/lease_mgr_factory.h>
-#include <dhcpsrv/testutils/mysql_schema.h>
-using namespace isc::dhcp::bench;
-using namespace isc::dhcp::test;
+#include <mysql/testutils/mysql_schema.h>
+
+using namespace isc::db::test;
using namespace isc::dhcp;
+using namespace isc::dhcp::bench;
using namespace std;
namespace {
/// @brief This is a fixture class used for benchmarking MySQL lease backend
-class MySqlLeaseMgrBenchmark : public GenericLeaseMgrBenchmark {
-public:
+struct MySqlLeaseMgrBenchmark : public GenericLeaseMgrBenchmark {
/// @brief Setup routine.
///
/// It cleans up schema and recreates tables, then instantiates LeaseMgr
lmptr_ = &(LeaseMgrFactory::instance());
}
+ void SetUp(::benchmark::State& s) override {
+ ::benchmark::State const& cs = s;
+ SetUp(cs);
+ }
+
/// @brief Cleans up after the test.
void TearDown(::benchmark::State const&) override {
try {
// If data wipe enabled, delete transient data otherwise destroy the schema.
destroyMySQLSchema();
}
+
+ void TearDown(::benchmark::State& s) override {
+ ::benchmark::State const& cs = s;
+ TearDown(cs);
+ }
};
// Defines a benchmark that measures IPv4 leases insertion.
// Defines a benchmark that measures IPv6 leases retrieval by lease type, duid, iaid
// and subnet-id.
BENCHMARK_DEFINE_F(MySqlLeaseMgrBenchmark, getLease6_type_duid_iaid_subnetid)
- (benchmark::State& state) {
+(benchmark::State& state) {
const size_t lease_count = state.range(0);
while (state.KeepRunning()) {
setUpWithInserts6(state, lease_count);
}
}
-
/// The following macros define run parameters for previously defined
/// MySQL benchmarks.
/// A benchmark that measures IPv4 leases insertion.
BENCHMARK_REGISTER_F(MySqlLeaseMgrBenchmark, insertLeases4)
- ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)->Unit(UNIT);
+ ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)
+ ->Unit(UNIT);
/// A benchmark that measures IPv4 leases update.
BENCHMARK_REGISTER_F(MySqlLeaseMgrBenchmark, updateLeases4)
- ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)->Unit(UNIT);
+ ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)
+ ->Unit(UNIT);
/// A benchmark that measures IPv4 lease retrieval by IP address.
BENCHMARK_REGISTER_F(MySqlLeaseMgrBenchmark, getLease4_address)
- ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)->Unit(UNIT);
+ ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)
+ ->Unit(UNIT);
/// A benchmark that measures IPv4 lease retrieval by hardware address.
BENCHMARK_REGISTER_F(MySqlLeaseMgrBenchmark, getLease4_hwaddr)
- ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)->Unit(UNIT);
+ ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)
+ ->Unit(UNIT);
/// A benchmark that measures IPv4 lease retrieval by hardware address and a
/// subnet-id.
BENCHMARK_REGISTER_F(MySqlLeaseMgrBenchmark, getLease4_hwaddr_subnetid)
- ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)->Unit(UNIT);
+ ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)
+ ->Unit(UNIT);
/// A benchmark that measures IPv4 lease retrieval by client-id.
BENCHMARK_REGISTER_F(MySqlLeaseMgrBenchmark, getLease4_clientid)
- ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)->Unit(UNIT);
+ ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)
+ ->Unit(UNIT);
/// A benchmark that measures IPv4 lease retrieval by client-id and subnet-id.
BENCHMARK_REGISTER_F(MySqlLeaseMgrBenchmark, getLease4_clientid_subnetid)
- ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)->Unit(UNIT);
+ ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)
+ ->Unit(UNIT);
/// A benchmark that measures expired IPv4 leases retrieval.
BENCHMARK_REGISTER_F(MySqlLeaseMgrBenchmark, getExpiredLeases4)
- ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)->Unit(UNIT);
+ ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)
+ ->Unit(UNIT);
/// A benchmark that measures IPv6 leases insertion.
BENCHMARK_REGISTER_F(MySqlLeaseMgrBenchmark, insertLeases6)
- ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)->Unit(UNIT);
+ ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)
+ ->Unit(UNIT);
/// A benchmark that measures IPv6 leases update.
BENCHMARK_REGISTER_F(MySqlLeaseMgrBenchmark, updateLeases6)
- ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)->Unit(UNIT);
+ ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)
+ ->Unit(UNIT);
/// A benchmark that measures IPv6 lease retrieval by lease type and IP address.
BENCHMARK_REGISTER_F(MySqlLeaseMgrBenchmark, getLease6_type_address)
- ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)->Unit(UNIT);
+ ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)
+ ->Unit(UNIT);
/// A benchmark that measures IPv6 lease retrieval by lease type, duid and iaid.
BENCHMARK_REGISTER_F(MySqlLeaseMgrBenchmark, getLease6_type_duid_iaid)
- ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)->Unit(UNIT);
+ ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)
+ ->Unit(UNIT);
/// A benchmark that measures IPv6 lease retrieval by lease type, duid, iaid and
/// subnet-id.
BENCHMARK_REGISTER_F(MySqlLeaseMgrBenchmark, getLease6_type_duid_iaid_subnetid)
- ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)->Unit(UNIT);
+ ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)
+ ->Unit(UNIT);
/// A benchmark that measures expired IPv6 leases retrieval.
BENCHMARK_REGISTER_F(MySqlLeaseMgrBenchmark, getExpiredLeases6)
- ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)->Unit(UNIT);
+ ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)
+ ->Unit(UNIT);
} // namespace
/// @brief A maximum number of leases used in a benchmark
constexpr size_t MAX_LEASE_COUNT = 0xfffd;
- /// @brief A minimum number of leases used in a benchmark
+/// @brief A minimum number of leases used in a benchmark
constexpr size_t MIN_HOST_COUNT = 512;
/// @brief A maximum number of leases used in a benchmark
constexpr size_t MAX_HOST_COUNT = 0xfffd;
/// @}
-}
-}
-}
+} // namespace bench
+} // namespace dhcp
+} // namespace isc
#endif
#include <dhcpsrv/benchmarks/generic_host_data_source_benchmark.h>
#include <dhcpsrv/benchmarks/parameters.h>
#include <dhcpsrv/host_data_source_factory.h>
-#include <dhcpsrv/testutils/pgsql_schema.h>
+#include <dhcpsrv/host_mgr.h>
+
+#include <pgsql/testutils/pgsql_schema.h>
+
#include <iostream>
+using namespace isc::db::test;
using namespace isc::dhcp::bench;
-using namespace isc::dhcp::test;
using namespace isc::dhcp;
using namespace std;
namespace {
/// @brief This is a fixture class used for benchmarking PostgreSQL host backend
-class PgSqlHostDataSourceBenchmark : public GenericHostDataSourceBenchmark {
-public:
-
+struct PgSqlHostDataSourceBenchmark : public GenericHostDataSourceBenchmark {
/// @brief Setup routine.
///
/// It cleans up schema and recreates tables, then instantiates HostMgr
// Ensure we have the proper schema with no transient data.
createPgSQLSchema();
try {
- HostDataSourceFactory::destroy();
- HostDataSourceFactory::create(validPgSQLConnectionString());
+ HostMgr::delBackend("postgresql");
+ HostMgr::addBackend(validPgSQLConnectionString());
} catch (...) {
cerr << "ERROR: unable to open database" << endl;
throw;
}
- hdsptr_ = HostDataSourceFactory::getHostDataSourcePtr();
+ hdsptr_ = HostMgr::instance().getHostDataSource();
+ }
+
+ void SetUp(::benchmark::State& s) override {
+ ::benchmark::State const& cs = s;
+ SetUp(cs);
}
/// @brief Cleans up after the test.
" is opened in read-only mode, continuing..."
<< endl;
}
- HostDataSourceFactory::destroy();
+ HostMgr::delBackend("postgresql");
// If data wipe enabled, delete transient data otherwise destroy the schema
destroyPgSQLSchema();
}
+
+ void TearDown(::benchmark::State& s) override {
+ ::benchmark::State const& cs = s;
+ TearDown(cs);
+ }
};
/// Defines steps necessary for conducting a benchmark that measures
}
}
-/// Defines steps necessary for conducting a benchmark that measures
-/// hosts retrieval by getAll(hw-addr, duid) call.
-BENCHMARK_DEFINE_F(PgSqlHostDataSourceBenchmark, getAllByHWAddrDuid)(benchmark::State& state) {
- const size_t host_count = state.range(0);
- while (state.KeepRunning()) {
- setUpWithInserts(state, host_count);
- benchGetAllByHWAddrDuid();
- }
-}
-
/// Defines steps necessary for conducting a benchmark that measures
/// hosts retrieval by getAll4(hw-addr, duid) call.
BENCHMARK_DEFINE_F(PgSqlHostDataSourceBenchmark, getAll)(benchmark::State& state) {
}
}
-/// Defines steps necessary for conducting a benchmark that measures
-/// hosts retrieval by get4(subnet-id, hw-addr, duid) call.
-BENCHMARK_DEFINE_F(PgSqlHostDataSourceBenchmark, get4BySubnetHWAddrDuid)(benchmark::State& state) {
- const size_t host_count = state.range(0);
- while (state.KeepRunning()) {
- setUpWithInserts(state, host_count);
- benchGet4BySubnetHWAddrDuid();
- }
-}
-
/// Defines steps necessary for conducting a benchmark that measures
/// hosts retrieval by get4(identifier-type, identifier, subnet-id) call.
BENCHMARK_DEFINE_F(PgSqlHostDataSourceBenchmark, get4IdentifierSubnetId)(benchmark::State& state) {
}
}
-/// Defines steps necessary for conducting a benchmark that measures
-/// hosts retrieval by get6(subnet-id, duid, hw-addr) call.
-BENCHMARK_DEFINE_F(PgSqlHostDataSourceBenchmark, get6SubnetIdDuidHWAddr)(benchmark::State& state) {
- const size_t host_count = state.range(0);
- while (state.KeepRunning()) {
- setUpWithInserts(state, host_count);
- benchGet6SubnetIdDuidHWAddr();
- }
-}
-
/// Defines steps necessary for conducting a benchmark that measures
/// hosts retrieval by get6(subnet-id, identifier-type, identifier) call.
BENCHMARK_DEFINE_F(PgSqlHostDataSourceBenchmark, get6IdentifierSubnetId)(benchmark::State& state) {
/// Defines parameters necessary for running a benchmark that measures
/// hosts insertion.
BENCHMARK_REGISTER_F(PgSqlHostDataSourceBenchmark, insertHosts)
- ->Range(MIN_HOST_COUNT, MAX_HOST_COUNT)->Unit(UNIT);
+ ->Range(MIN_HOST_COUNT, MAX_HOST_COUNT)
+ ->Unit(UNIT);
/// Defines parameters necessary for running a benchmark that measures
/// hosts update.
BENCHMARK_REGISTER_F(PgSqlHostDataSourceBenchmark, updateHosts)
- ->Range(MIN_HOST_COUNT, MAX_HOST_COUNT)->Unit(UNIT);
-
-/// Defines parameters necessary for running a benchmark that measures
-/// hosts retrieval by getAll(hw-addr, duid) call.
-BENCHMARK_REGISTER_F(PgSqlHostDataSourceBenchmark, getAllByHWAddrDuid)
- ->Range(MIN_HOST_COUNT, MAX_HOST_COUNT)->Unit(UNIT);
+ ->Range(MIN_HOST_COUNT, MAX_HOST_COUNT)
+ ->Unit(UNIT);
/// Defines parameters necessary for running a benchmark that measures
/// hosts retrieval by getAll4(hw-addr, duid) call.
BENCHMARK_REGISTER_F(PgSqlHostDataSourceBenchmark, getAll)
- ->Range(MIN_HOST_COUNT, MAX_HOST_COUNT)->Unit(UNIT);
+ ->Range(MIN_HOST_COUNT, MAX_HOST_COUNT)
+ ->Unit(UNIT);
/// Defines parameters necessary for running a benchmark that measures
/// hosts retrieval by getAll(v4-reservation) call.
BENCHMARK_REGISTER_F(PgSqlHostDataSourceBenchmark, getAllv4Resv)
- ->Range(MIN_HOST_COUNT, MAX_HOST_COUNT)->Unit(UNIT);
-
-/// Defines parameters necessary for running a benchmark that measures
-/// hosts retrieval by get4(subnet-id, hw-addr, duid) call.
-BENCHMARK_REGISTER_F(PgSqlHostDataSourceBenchmark, get4BySubnetHWAddrDuid)
- ->Range(MIN_HOST_COUNT, MAX_HOST_COUNT)->Unit(UNIT);
+ ->Range(MIN_HOST_COUNT, MAX_HOST_COUNT)
+ ->Unit(UNIT);
/// Defines parameters necessary for running a benchmark that measures
/// hosts retrieval by get4(identifier-type, identifier, subnet-id) call.
BENCHMARK_REGISTER_F(PgSqlHostDataSourceBenchmark, get4IdentifierSubnetId)
- ->Range(MIN_HOST_COUNT, MAX_HOST_COUNT)->Unit(UNIT);
+ ->Range(MIN_HOST_COUNT, MAX_HOST_COUNT)
+ ->Unit(UNIT);
/// Defines parameters necessary for running a benchmark that measures
/// hosts retrieval by get4(subnet-id, v4-reservation) call.
BENCHMARK_REGISTER_F(PgSqlHostDataSourceBenchmark, get4SubnetIdv4Resrv)
- ->Range(MIN_HOST_COUNT, MAX_HOST_COUNT)->Unit(UNIT);
-
-/// Defines parameters necessary for running a benchmark that measures
-/// hosts retrieval by get6(subnet-id, duid, hw-addr) call.
-BENCHMARK_REGISTER_F(PgSqlHostDataSourceBenchmark, get6SubnetIdDuidHWAddr)
- ->Range(MIN_HOST_COUNT, MAX_HOST_COUNT)->Unit(UNIT);
+ ->Range(MIN_HOST_COUNT, MAX_HOST_COUNT)
+ ->Unit(UNIT);
/// Defines parameters necessary for running a benchmark that measures
/// hosts retrieval by get6(subnet-id, identifier-type, identifier) call.
BENCHMARK_REGISTER_F(PgSqlHostDataSourceBenchmark, get6IdentifierSubnetId)
- ->Range(MIN_HOST_COUNT, MAX_HOST_COUNT)->Unit(UNIT);
+ ->Range(MIN_HOST_COUNT, MAX_HOST_COUNT)
+ ->Unit(UNIT);
/// Defines parameters necessary for running a benchmark that measures
/// hosts retrieval by get6(subnet-id, ip-address) call.
BENCHMARK_REGISTER_F(PgSqlHostDataSourceBenchmark, get6SubnetIdAddr)
- ->Range(MIN_HOST_COUNT, MAX_HOST_COUNT)->Unit(UNIT);
+ ->Range(MIN_HOST_COUNT, MAX_HOST_COUNT)
+ ->Unit(UNIT);
/// Defines parameters necessary for running a benchmark that measures
/// hosts retrieval by get6(ip-prefix, prefix-len) call.
BENCHMARK_REGISTER_F(PgSqlHostDataSourceBenchmark, get6Prefix)
- ->Range(MIN_HOST_COUNT, MAX_HOST_COUNT)->Unit(UNIT);
+ ->Range(MIN_HOST_COUNT, MAX_HOST_COUNT)
+ ->Unit(UNIT);
} // namespace
#include <dhcpsrv/benchmarks/generic_lease_mgr_benchmark.h>
#include <dhcpsrv/benchmarks/parameters.h>
#include <dhcpsrv/lease_mgr_factory.h>
-#include <dhcpsrv/testutils/pgsql_schema.h>
-using namespace isc::dhcp::bench;
-using namespace isc::dhcp::test;
+#include <pgsql/testutils/pgsql_schema.h>
+
+using namespace isc::db::test;
using namespace isc::dhcp;
+using namespace isc::dhcp::bench;
using namespace std;
namespace {
/// @brief This is a fixture class used for benchmarking PostgreSQL lease backend
-class PgSqlLeaseMgrBenchmark : public GenericLeaseMgrBenchmark {
-public:
+struct PgSqlLeaseMgrBenchmark : public GenericLeaseMgrBenchmark {
/// @brief Setup routine.
///
/// It cleans up schema and recreates tables, then instantiates LeaseMgr
lmptr_ = &(LeaseMgrFactory::instance());
}
+ void SetUp(::benchmark::State& s) override {
+ ::benchmark::State const& cs = s;
+ SetUp(cs);
+ }
+
/// @brief Cleans up after the test.
void TearDown(::benchmark::State const&) override {
try {
// If data wipe enabled, delete transient data otherwise destroy the schema
destroyPgSQLSchema();
}
+
+ void TearDown(::benchmark::State& s) override {
+ ::benchmark::State const& cs = s;
+ TearDown(cs);
+ }
};
// Defines a benchmark that measures IPv4 leases insertion.
// Defines a benchmark that measures IPv6 leases retrieval by lease type, duid, iaid
// and subnet-id.
BENCHMARK_DEFINE_F(PgSqlLeaseMgrBenchmark, getLease6_type_duid_iaid_subnetid)
- (benchmark::State& state) {
+(benchmark::State& state) {
const size_t lease_count = state.range(0);
while (state.KeepRunning()) {
setUpWithInserts6(state, lease_count);
}
}
-
/// The following macros define run parameters for previously defined
/// PostgreSQL benchmarks.
/// A benchmark that measures IPv4 leases insertion.
BENCHMARK_REGISTER_F(PgSqlLeaseMgrBenchmark, insertLeases4)
- ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)->Unit(UNIT);
+ ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)
+ ->Unit(UNIT);
/// A benchmark that measures IPv4 leases update.
BENCHMARK_REGISTER_F(PgSqlLeaseMgrBenchmark, updateLeases4)
- ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)->Unit(UNIT);
+ ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)
+ ->Unit(UNIT);
/// A benchmark that measures IPv4 lease retrieval by IP address.
BENCHMARK_REGISTER_F(PgSqlLeaseMgrBenchmark, getLease4_address)
- ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)->Unit(UNIT);
+ ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)
+ ->Unit(UNIT);
/// A benchmark that measures IPv4 lease retrieval by hardware address.
BENCHMARK_REGISTER_F(PgSqlLeaseMgrBenchmark, getLease4_hwaddr)
- ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)->Unit(UNIT);
+ ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)
+ ->Unit(UNIT);
/// A benchmark that measures IPv4 lease retrieval by hardware address and a
/// subnet-id.
BENCHMARK_REGISTER_F(PgSqlLeaseMgrBenchmark, getLease4_hwaddr_subnetid)
- ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)->Unit(UNIT);
+ ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)
+ ->Unit(UNIT);
/// A benchmark that measures IPv4 lease retrieval by client-id.
BENCHMARK_REGISTER_F(PgSqlLeaseMgrBenchmark, getLease4_clientid)
- ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)->Unit(UNIT);
+ ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)
+ ->Unit(UNIT);
/// A benchmark that measures IPv4 lease retrieval by client-id and subnet-id.
BENCHMARK_REGISTER_F(PgSqlLeaseMgrBenchmark, getLease4_clientid_subnetid)
- ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)->Unit(UNIT);
+ ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)
+ ->Unit(UNIT);
/// A benchmark that measures expired IPv4 leases retrieval.
BENCHMARK_REGISTER_F(PgSqlLeaseMgrBenchmark, getExpiredLeases4)
- ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)->Unit(UNIT);
+ ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)
+ ->Unit(UNIT);
/// A benchmark that measures IPv6 leases insertion.
BENCHMARK_REGISTER_F(PgSqlLeaseMgrBenchmark, insertLeases6)
- ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)->Unit(UNIT);
+ ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)
+ ->Unit(UNIT);
/// A benchmark that measures IPv6 leases update.
BENCHMARK_REGISTER_F(PgSqlLeaseMgrBenchmark, updateLeases6)
- ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)->Unit(UNIT);
+ ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)
+ ->Unit(UNIT);
/// A benchmark that measures IPv6 lease retrieval by lease type and IP address.
BENCHMARK_REGISTER_F(PgSqlLeaseMgrBenchmark, getLease6_type_address)
- ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)->Unit(UNIT);
+ ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)
+ ->Unit(UNIT);
/// A benchmark that measures IPv6 lease retrieval by lease type, duid and iaid.
BENCHMARK_REGISTER_F(PgSqlLeaseMgrBenchmark, getLease6_type_duid_iaid)
- ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)->Unit(UNIT);
+ ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)
+ ->Unit(UNIT);
/// A benchmark that measures IPv6 lease retrieval by lease type, duid, iaid and
/// subnet-id.
BENCHMARK_REGISTER_F(PgSqlLeaseMgrBenchmark, getLease6_type_duid_iaid_subnetid)
- ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)->Unit(UNIT);
+ ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)
+ ->Unit(UNIT);
/// A benchmark that measures expired IPv6 leases retrieval.
BENCHMARK_REGISTER_F(PgSqlLeaseMgrBenchmark, getExpiredLeases6)
- ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)->Unit(UNIT);
+ ->Range(MIN_LEASE_COUNT, MAX_LEASE_COUNT)
+ ->Unit(UNIT);
} // namespace
#include <log/logger_support.h>
/// @brief A simple class that initializes logging.
-class Initializer {
-public:
+struct Initializer {
Initializer() {
isc::log::initLogger();
}
Initializer initializer;
-BENCHMARK_MAIN()
-
+BENCHMARK_MAIN();