![]() |
Kea 2.0.2
|
Base fixture class for benchmarking host backends. More...
#include <generic_host_data_source_benchmark.h>
Inheritance diagram for isc::dhcp::bench::GenericHostDataSourceBenchmark:Public Types | |
| enum | AddedOptions { DHCP4_ONLY , DHCP6_ONLY , DHCP4_AND_DHCP6 } |
| Defines what kind of options should be added for a host. More... | |
| enum | Universe { V4 , V6 } |
| Defines universe (IPv4 or IPv6) More... | |
Public Member Functions | |
| GenericHostDataSourceBenchmark () | |
| Constructor. More... | |
| virtual | ~GenericHostDataSourceBenchmark () |
| Destructor. More... | |
| void | addTestOptions (const HostPtr &host, const bool formatted, const AddedOptions &added_options) const |
| Adds several v4 and/or v6 options to the host. More... | |
| void | benchGet4IdentifierSubnetId () |
| Essential steps requires to benchmark host reservation retrieval using getAll(identifier-type, identifier, subnet-id) call. More... | |
| void | benchGet4SubnetIdv4Resrv () |
| Essential steps requires to benchmark host reservation retrieval using getAll(v4-reservation) call. More... | |
| void | benchGet6IdentifierSubnetId () |
| Essential steps requires to benchmark host reservation retrieval using get6(identifier-type, identifier, subnet-id) call. More... | |
| void | benchGet6Prefix () |
| Essential steps requires to benchmark host reservation retrieval using get6(prefix, len) call. More... | |
| void | benchGet6SubnetIdAddr () |
| Essential steps requires to benchmark host reservation retrieval using get6(ip-addr, subnet-id) call. More... | |
| void | benchGetAll () |
| Essential steps required to benchmark the getAll(identifier-type, identifier) call. More... | |
| 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 |
| Creates an option with addresses. More... | |
| OptionDescriptor | createEmptyOption (const Option::Universe &universe, const uint16_t option_type, const bool persist) const |
| Creates a generic option with specific parameters. More... | |
| template<typename OptionType , typename DataType > | |
| OptionDescriptor | createOption (const Option::Universe &universe, const uint16_t option_type, const bool persist, const bool formatted, const DataType &value) const |
| Creates an option of specified type and value. More... | |
| OptionDescriptor | createVendorOption (const Option::Universe &universe, const bool persist, const bool formatted, const uint32_t vendor_id) const |
| creates a vendor-option More... | |
| void | getAllv4Resv () |
| Essential steps required to benchmark host reservation retrieval using getAll(ipv4-reservation) call. More... | |
| void | insertHosts () |
| Inserts all hosts stored in hosts_ into the benchmarked host backend. More... | |
| void | prepareHosts (size_t const &host_count) |
| Creates specified number of hosts and stores them in hosts_. More... | |
| void | setUp (::benchmark::State &state, size_t const &host_count) |
| Sets up timers, creates and inserts hosts. More... | |
| void | setUpWithInserts (::benchmark::State &state, size_t const &host_count) |
| Sets up the benchmark with specified number of hosts. More... | |
Public Attributes | |
| HostDataSourcePtr | hdsptr_ |
| Pointer to the host backend being benchmarked. More... | |
| HostCollection | hosts_ |
| Store hosts being used during benchmark. More... | |
Base fixture class for benchmarking host backends.
Definition at line 31 of file generic_host_data_source_benchmark.h.
Defines what kind of options should be added for a host.
| Enumerator | |
|---|---|
| DHCP4_ONLY | DHCPv4-only options. |
| DHCP6_ONLY | DHCPv6-only options. |
| DHCP4_AND_DHCP6 | Both DHCPv4 and DHCPv6 options. |
Definition at line 37 of file generic_host_data_source_benchmark.h.
Defines universe (IPv4 or IPv6)
| Enumerator | |
|---|---|
| V4 | |
| V6 | |
Definition at line 34 of file generic_host_data_source_benchmark.h.
| isc::dhcp::bench::GenericHostDataSourceBenchmark::GenericHostDataSourceBenchmark | ( | ) |
Constructor.
Clears runtime option definitions.
Definition at line 43 of file generic_host_data_source_benchmark.cc.
References isc::dhcp::LibDHCP::clearRuntimeOptionDefs().
Here is the call graph for this function:
|
virtual |
Destructor.
Clears runtime option definitions and clears hdsptr_ pointer.
Definition at line 47 of file generic_host_data_source_benchmark.cc.
References isc::dhcp::LibDHCP::clearRuntimeOptionDefs(), and hdsptr_.
Here is the call graph for this function:| void isc::dhcp::bench::GenericHostDataSourceBenchmark::addTestOptions | ( | const HostPtr & | host, |
| const bool | formatted, | ||
| const AddedOptions & | added_options | ||
| ) | const |
Adds several v4 and/or v6 options to the host.
| host | host reservation to be extended with options |
| formatted | whether to generate text representation |
| added_options | v4, v6 or both |
Definition at line 98 of file generic_host_data_source_benchmark.cc.
References isc::dhcp::OptionDefSpaceContainer::addItem(), createEmptyOption(), createVendorOption(), D6O_BOOTFILE_URL, D6O_INFORMATION_REFRESH_TIME, DHCP4_AND_DHCP6, DHCP4_ONLY, DHCP4_OPTION_SPACE, DHCP6_ONLY, DHCP6_OPTION_SPACE, isc::dhcp::DHO_BOOT_FILE_NAME, isc::dhcp::DHO_DEFAULT_IP_TTL, isc::dhcp::LibDHCP::setRuntimeOptionDefs(), isc::dhcp::Option::V4, and isc::dhcp::Option::V6.
Referenced by prepareHosts().
Here is the call graph for this function:| void isc::dhcp::bench::GenericHostDataSourceBenchmark::benchGet4IdentifierSubnetId | ( | ) |
Essential steps requires to benchmark host reservation retrieval using getAll(identifier-type, identifier, subnet-id) call.
Definition at line 207 of file generic_host_data_source_benchmark.cc.
| void isc::dhcp::bench::GenericHostDataSourceBenchmark::benchGet4SubnetIdv4Resrv | ( | ) |
Essential steps requires to benchmark host reservation retrieval using getAll(v4-reservation) call.
Definition at line 216 of file generic_host_data_source_benchmark.cc.
| void isc::dhcp::bench::GenericHostDataSourceBenchmark::benchGet6IdentifierSubnetId | ( | ) |
Essential steps requires to benchmark host reservation retrieval using get6(identifier-type, identifier, subnet-id) call.
Definition at line 223 of file generic_host_data_source_benchmark.cc.
| void isc::dhcp::bench::GenericHostDataSourceBenchmark::benchGet6Prefix | ( | ) |
Essential steps requires to benchmark host reservation retrieval using get6(prefix, len) call.
Definition at line 240 of file generic_host_data_source_benchmark.cc.
| void isc::dhcp::bench::GenericHostDataSourceBenchmark::benchGet6SubnetIdAddr | ( | ) |
Essential steps requires to benchmark host reservation retrieval using get6(ip-addr, subnet-id) call.
Definition at line 232 of file generic_host_data_source_benchmark.cc.
| void isc::dhcp::bench::GenericHostDataSourceBenchmark::benchGetAll | ( | ) |
Essential steps required to benchmark the getAll(identifier-type, identifier) call.
Definition at line 192 of file generic_host_data_source_benchmark.cc.
|
inline |
Creates an option with addresses.
| OptionType | specifies a class to be instantiated |
| option_type | code of the option |
| persist | whether the option should always be included (yes) or not (no) |
| formatted | whether the value passed to description should be converted to text |
| address1 | first address to be used (optional) |
| address2 | second address to be used (optional) |
| address3 | third address to be used (optional) |
Definition at line 101 of file generic_host_data_source_benchmark.h.
| OptionDescriptor isc::dhcp::bench::GenericHostDataSourceBenchmark::createEmptyOption | ( | const Option::Universe & | universe, |
| const uint16_t | option_type, | ||
| const bool | persist | ||
| ) | const |
Creates a generic option with specific parameters.
| universe | (v4 or v6) |
| option_type | code of the option |
| persist | whether the option should always be included (yes) or not (no) |
Definition at line 71 of file generic_host_data_source_benchmark.cc.
Referenced by addTestOptions().
|
inline |
Creates an option of specified type and value.
| OptionType | Option class to be instantiated |
| DataType | type of parameter to be passed to OptionType constructor |
| universe | (v4 or v6) |
| option_type | code of the option |
| persist | whether the option should always be included (yes) or not (no) |
| formatted | whether the value passed to description should be converted to text |
| value | option value |
Definition at line 74 of file generic_host_data_source_benchmark.h.
| OptionDescriptor isc::dhcp::bench::GenericHostDataSourceBenchmark::createVendorOption | ( | const Option::Universe & | universe, |
| const bool | persist, | ||
| const bool | formatted, | ||
| const uint32_t | vendor_id | ||
| ) | const |
creates a vendor-option
| universe | (v4 or v6) |
| persist | whether the option should always be included |
| formatted | whether the value passed to description should be converted to text |
| vendor_id | 32-unsigned bit enterprise-id |
Definition at line 80 of file generic_host_data_source_benchmark.cc.
Referenced by addTestOptions().
| void isc::dhcp::bench::GenericHostDataSourceBenchmark::getAllv4Resv | ( | ) |
Essential steps required to benchmark host reservation retrieval using getAll(ipv4-reservation) call.
Definition at line 200 of file generic_host_data_source_benchmark.cc.
| void isc::dhcp::bench::GenericHostDataSourceBenchmark::insertHosts | ( | ) |
Inserts all hosts stored in hosts_ into the benchmarked host backend.
Definition at line 185 of file generic_host_data_source_benchmark.cc.
References hdsptr_, and hosts_.
Referenced by setUpWithInserts().
| void isc::dhcp::bench::GenericHostDataSourceBenchmark::prepareHosts | ( | size_t const & | host_count | ) |
Creates specified number of hosts and stores them in hosts_.
| host_count | number of hosts to be created |
Definition at line 164 of file generic_host_data_source_benchmark.cc.
References addTestOptions(), DHCP4_AND_DHCP6, hosts_, and isc::dhcp::Host::IDENT_HWADDR.
Referenced by setUp(), and setUpWithInserts().
Here is the call graph for this function:| void isc::dhcp::bench::GenericHostDataSourceBenchmark::setUp | ( | ::benchmark::State & | state, |
| size_t const & | host_count | ||
| ) |
Sets up timers, creates and inserts hosts.
| state | reference to the state of the benchmark |
| host_count | number of hosts to be created |
Definition at line 53 of file generic_host_data_source_benchmark.cc.
References prepareHosts().
Here is the call graph for this function:| void isc::dhcp::bench::GenericHostDataSourceBenchmark::setUpWithInserts | ( | ::benchmark::State & | state, |
| size_t const & | host_count | ||
| ) |
Sets up the benchmark with specified number of hosts.
| state | reference to the state of the benchmark |
| host_count | number of hosts to be created |
Definition at line 61 of file generic_host_data_source_benchmark.cc.
References insertHosts(), and prepareHosts().
Here is the call graph for this function:| HostDataSourcePtr isc::dhcp::bench::GenericHostDataSourceBenchmark::hdsptr_ |
Pointer to the host backend being benchmarked.
Definition at line 214 of file generic_host_data_source_benchmark.h.
Referenced by ~GenericHostDataSourceBenchmark(), benchGet4IdentifierSubnetId(), benchGet4SubnetIdv4Resrv(), benchGet6IdentifierSubnetId(), benchGet6Prefix(), benchGet6SubnetIdAddr(), benchGetAll(), getAllv4Resv(), and insertHosts().
| HostCollection isc::dhcp::bench::GenericHostDataSourceBenchmark::hosts_ |
Store hosts being used during benchmark.
Definition at line 217 of file generic_host_data_source_benchmark.h.
Referenced by benchGet4IdentifierSubnetId(), benchGet4SubnetIdv4Resrv(), benchGet6IdentifierSubnetId(), benchGet6Prefix(), benchGet6SubnetIdAddr(), benchGetAll(), getAllv4Resv(), insertHosts(), and prepareHosts().