 |
Kea
1.5.0
|
Go to the documentation of this file.
31 #include <dhcpsrv/testutils/schema.h>
32 #include <dhcpsrv/testutils/host_data_source_utils.h>
35 using isc::dhcp::test::HostDataSourceUtils;
55 size_t const& host_count) {
64 size_t const& host_count) {
74 const uint16_t option_type,
75 const bool persist)
const {
85 const uint32_t vendor_id)
const {
111 opts->add(createOption<OptionUint32>(
Option::V4, 1,
false, formatted, 312131),
112 "vendor-encapsulated-options");
113 opts->add(createAddressOption<Option4AddrLst>(254,
false, formatted,
"192.0.2.3"),
116 opts->add(createAddressOption<Option4AddrLst>(2,
false, formatted,
"10.0.0.5",
117 "10.0.0.3",
"10.0.3.4"),
"isc");
121 "uint32")),
"vendor-encapsulated-options");
137 opts->add(createAddressOption<Option6AddrLst>(1024,
false, formatted,
"2001:db8:1::1"),
140 opts->add(createAddressOption<Option6AddrLst>(2,
false, formatted,
"3000::1",
"3000::2",
159 if (host_count > 0xfffdu) {
160 cerr <<
"host_count <= 0xfffd or change address xgeneration in "
161 "GenericLeaseMgrBenchmark::prepareLeases6()"
165 for (
size_t i = 0x0001u; i < 0x0001u + host_count; ++i) {
166 std::stringstream ss;
171 const std::string prefix = std::string(
"2001:db8::") + n_host;
196 hdsptr_->getAll(host->getHWAddress(), host->getDuid());
203 std::vector<uint8_t> hwaddr = host->getIdentifier();
204 hdsptr_->getAll(host->getIdentifierType(), &hwaddr[0], hwaddr.size());
211 hdsptr_->getAll4(host->getIPv4Reservation());
218 std::vector<uint8_t> hwaddr = host->getIdentifier();
220 host->getIdentifierType())), host->getDuid());
227 std::vector<uint8_t> hwaddr = host->getIdentifier();
228 hdsptr_->get4(host->getIPv4SubnetID(), host->getIdentifierType(),
229 &hwaddr[0], hwaddr.size());
236 hdsptr_->get4(host->getIPv4SubnetID(), host->getIPv4Reservation());
243 hdsptr_->get6(host->getIPv6SubnetID(), host->getDuid(),
244 host->getHWAddress());
251 std::vector<uint8_t> hwaddr = host->getIdentifier();
252 hdsptr_->get6(host->getIPv6SubnetID(), host->getIdentifierType(),
253 &hwaddr[0], hwaddr.size());
261 hdsptr_->get6(host->getIPv6SubnetID(), range.first->second.getPrefix());
269 hdsptr_->get6(range.first->second.getPrefix(),
270 range.first->second.getPrefixLen());
HostCollection hosts_
Store hosts being used during benchmark.
void addItem(const ItemType &item, const Selector &option_space)
Adds a new item to the option_space.
boost::shared_ptr< OptionDefinition > OptionDefinitionPtr
Pointer to option definition object.
@ DHCP6_ONLY
DHCPv6-only options.
void benchGetAllByHWAddrDuid()
The IOAddress class represents an IP addresses (version agnostic)
void benchGet4BySubnetHWAddrDuid()
Essential steps requires to benchmark host reservation retrieval using getAll(hw-addr,...
void benchGet6SubnetIdDuidHWAddr()
Essential steps requires to benchmark host reservation retrieval using get6(subnet-id,...
void benchGetAll()
Essential steps required to benchmark the getAll(identifier-type, identifier) call.
void setUpWithInserts(::benchmark::State &state, size_t const &host_count)
Sets up the benchmark with specified number of hosts.
#define DHCP6_OPTION_SPACE
Hardware type that represents information from DHCPv4 packet.
void benchGet6IdentifierSubnetId()
Essential steps requires to benchmark host reservation retrieval using get6(identifier-type,...
void updateHosts()
Updates all hosts stored in hosts_ in the benchmarked host backend.
void insertHosts()
Inserts all hosts stored in hosts_ into the benchmarked host backend.
boost::shared_ptr< Host > HostPtr
Pointer to the Host object.
static void setRuntimeOptionDefs(const OptionDefSpaceContainer &defs)
Copies option definitions created at runtime.
OptionDescriptor createVendorOption(const Option::Universe &universe, const bool persist, const bool formatted, const uint32_t vendor_id) const
creates a vendor-option
Base class representing a DHCP option definition.
@ DHCP4_AND_DHCP6
Both DHCPv4 and DHCPv6 options.
Defines the logger used by the top-level component of kea-dhcp-ddns.
boost::shared_ptr< HWAddr > HWAddrPtr
Shared pointer to a hardware address structure.
void prepareHosts(size_t const &host_count)
Creates specified number of hosts and stores them in hosts_.
#define DHCP4_OPTION_SPACE
void benchGet6SubnetIdAddr()
Essential steps requires to benchmark host reservation retrieval using get6(ip-addr,...
@ D6O_INFORMATION_REFRESH_TIME
@ DHCP4_ONLY
DHCPv4-only options.
void getAllv4Resv()
Essential steps required to benchmark host reservation retrieval using getAll(ipv4-reservation) call.
AddedOptions
Defines what kind of options should be added for a host.
HostDataSourcePtr hdsptr_
Pointer to the host backend being benchmarked.
void addTestOptions(const HostPtr &host, const bool formatted, const AddedOptions &added_options) const
Adds several v4 and/or v6 options to the host.
This class represents vendor-specific information option.
std::vector< ConstHostPtr > ConstHostCollection
Collection of the const Host objects.
boost::shared_ptr< Option > OptionPtr
boost::shared_ptr< OptionVendor > OptionVendorPtr
Pointer to a vendor option.
OptionDescriptor createEmptyOption(const Option::Universe &universe, const uint16_t option_type, const bool persist) const
Creates a generic option with specific parameters.
static void clearRuntimeOptionDefs()
Removes runtime option definitions.
void setUp(::benchmark::State &state, size_t const &host_count)
Sets up timers, creates and inserts hosts.
boost::shared_ptr< CfgOption > CfgOptionPtr
Non-const pointer.
Universe
defines option universe DHCPv4 or DHCPv6
void benchGet4SubnetIdv4Resrv()
Essential steps requires to benchmark host reservation retrieval using getAll(v4-reservation) call.
void benchGet6Prefix()
Essential steps requires to benchmark host reservation retrieval using get6(prefix,...
void benchGet4IdentifierSubnetId()
Essential steps requires to benchmark host reservation retrieval using getAll(identifier-type,...
virtual ~GenericHostDataSourceBenchmark()
Destructor.
GenericHostDataSourceBenchmark()
Constructor.
std::pair< IPv6ResrvIterator, IPv6ResrvIterator > IPv6ResrvRange