Kea: generic_lease_mgr_benchmark.h Source File

| Kea 1.5.0

generic_lease_mgr_benchmark.h
Go to the documentation of this file.
1// Copyright (C) 2018 Internet Systems Consortium, Inc. ("ISC")
2// Copyright (C) 2017 Deutsche Telekom AG.
3//
4// Authors: Andrei Pavel <andrei.pavel@qualitance.com>
5//
6// Licensed under the Apache License, Version 2.0 (the "License");
7// you may not use this file except in compliance with the License.
8// You may obtain a copy of the License at
9//
10// http://www.apache.org/licenses/LICENSE-2.0
11//
12// Unless required by applicable law or agreed to in writing, software
13// distributed under the License is distributed on an "AS IS" BASIS,
14// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15// See the License for the specific language governing permissions and
16// limitations under the License.
17
18#ifndef GENERIC_LEASE_MGR_BENCHMARK_H
19#define GENERIC_LEASE_MGR_BENCHMARK_H
20
21#include <benchmark/benchmark.h>
22
23#include <dhcpsrv/lease_mgr.h>
24
25namespace isc {
26namespace dhcp {
27namespace bench {
28
30 class GenericLeaseMgrBenchmark : public benchmark::Fixture {
31public:
32
34 enum Universe { V4, V6 };
35
37 GenericLeaseMgrBenchmark();
38
40 virtual ~GenericLeaseMgrBenchmark();
41
46 void setUp4(::benchmark::State& state, size_t const& lease_count);
47
53 void setUpWithInserts4(::benchmark::State& state, size_t const& lease_count);
54
59 void setUp6(::benchmark::State& state, size_t const& lease_count);
60
66 void setUpWithInserts6(::benchmark::State& state, size_t const& lease_count);
67
72 void prepareLeases4(size_t const& lease_count);
73
75 void benchInsertLeases4();
76
78 void benchUpdateLeases4();
79
81 void benchGetLease4_address();
82
84 void benchGetLease4_hwaddr();
85
87 void benchGetLease4_hwaddr_subnetid();
88
90 void benchGetLease4_clientid();
91
93 void benchGetLease4_clientid_subnetid();
94
96 void benchGetExpiredLeases4();
97
102 void prepareLeases6(size_t const& lease_count);
103
105 void benchInsertLeases6();
106
108 void benchUpdateLeases6();
109
111 void benchGetLease6_type_address();
112
114 void benchGetLease6_type_duid_iaid();
115
117 void benchGetLease6_type_duid_iaid_subnetid();
118
120 void benchGetExpiredLeases6();
121
123 LeaseMgr* lmptr_;
124
126 Lease4Collection leases4_;
127
129 Lease6Collection leases6_;
130};
131
132} // namespace bench
133} // namespace dhcp
134} // namespace isc
135
136#endif
isc::dhcp::LeaseMgr
Abstract Lease Manager.
Definition: lease_mgr.h:222
isc::dhcp::bench::GenericLeaseMgrBenchmark
A base class for a fixture for specific lease manager benchmarks.
Definition: generic_lease_mgr_benchmark.h:30
isc::dhcp::bench::GenericLeaseMgrBenchmark::benchInsertLeases4
void benchInsertLeases4()
This step inserts all IPv4 leases stored in lease4_ into the LeaseMgr.
Definition: generic_lease_mgr_benchmark.cc:102
isc::dhcp::bench::GenericLeaseMgrBenchmark::GenericLeaseMgrBenchmark
GenericLeaseMgrBenchmark()
Constructor.
Definition: generic_lease_mgr_benchmark.cc:40
isc::dhcp::bench::GenericLeaseMgrBenchmark::benchGetLease4_clientid_subnetid
void benchGetLease4_clientid_subnetid()
This step retrieves IPv4 leases by (client-id, subnet-id) tuple.
Definition: generic_lease_mgr_benchmark.cc:144
isc::dhcp::bench::GenericLeaseMgrBenchmark::prepareLeases4
void prepareLeases4(size_t const &lease_count)
Prepares specified number of IPv4 leases.
Definition: generic_lease_mgr_benchmark.cc:84
isc::dhcp::bench::GenericLeaseMgrBenchmark::leases6_
Lease6Collection leases6_
List of IPv6 leases (useful during benchmarks)
Definition: generic_lease_mgr_benchmark.h:129
isc::dhcp::bench::GenericLeaseMgrBenchmark::benchUpdateLeases4
void benchUpdateLeases4()
This step updates all IPv4 leases stored in lease4_ in the LeaseMgr.
Definition: generic_lease_mgr_benchmark.cc:109
isc::dhcp::bench::GenericLeaseMgrBenchmark::lmptr_
LeaseMgr * lmptr_
Pointer to the lease manager being under evaluation.
Definition: generic_lease_mgr_benchmark.h:123
isc::dhcp::bench::GenericLeaseMgrBenchmark::benchUpdateLeases6
void benchUpdateLeases6()
This step updates all IPv6 leases stored in lease6_ in the LeaseMgr.
Definition: generic_lease_mgr_benchmark.cc:197
isc::dhcp::bench::GenericLeaseMgrBenchmark::benchGetLease4_hwaddr
void benchGetLease4_hwaddr()
This step retrieves IPv4 leases by hardware address.
Definition: generic_lease_mgr_benchmark.cc:123
isc::dhcp::bench::GenericLeaseMgrBenchmark::benchGetLease6_type_duid_iaid_subnetid
void benchGetLease6_type_duid_iaid_subnetid()
This step retrieves IPv6 leases by (type, duid, iaid, subnet-id) tuple.
Definition: generic_lease_mgr_benchmark.cc:218
isc::dhcp::bench::GenericLeaseMgrBenchmark::setUpWithInserts6
void setUpWithInserts6(::benchmark::State &state, size_t const &lease_count)
set up code (with lease preinsertion) for initializing IPv6 version of a benchmark.
Definition: generic_lease_mgr_benchmark.cc:74
isc::dhcp::bench::GenericLeaseMgrBenchmark::benchGetLease4_address
void benchGetLease4_address()
This step retrieves IPv4 leases by IP address.
Definition: generic_lease_mgr_benchmark.cc:116
isc::dhcp::bench::GenericLeaseMgrBenchmark::benchGetExpiredLeases6
void benchGetExpiredLeases6()
This step retrieves all expired IPv6 leases.
Definition: generic_lease_mgr_benchmark.cc:226
isc::dhcp::bench::GenericLeaseMgrBenchmark::benchGetLease4_clientid
void benchGetLease4_clientid()
This step retrieves IPv4 leases by client-id.
Definition: generic_lease_mgr_benchmark.cc:137
isc::dhcp::bench::GenericLeaseMgrBenchmark::benchGetLease6_type_duid_iaid
void benchGetLease6_type_duid_iaid()
This step retrieves IPv6 leases by (type, duid, iaid) tuple.
Definition: generic_lease_mgr_benchmark.cc:211
isc::dhcp::bench::GenericLeaseMgrBenchmark::setUpWithInserts4
void setUpWithInserts4(::benchmark::State &state, size_t const &lease_count)
set up code (with lease preinsertion) for initializing IPv4 version of a benchmark.
Definition: generic_lease_mgr_benchmark.cc:56
isc::dhcp::bench::GenericLeaseMgrBenchmark::leases4_
Lease4Collection leases4_
List of IPv4 leases (useful during benchmarks)
Definition: generic_lease_mgr_benchmark.h:126
isc::dhcp::bench::GenericLeaseMgrBenchmark::benchGetExpiredLeases4
void benchGetExpiredLeases4()
This step retrieves all expired IPv4 leases.
Definition: generic_lease_mgr_benchmark.cc:151
isc::dhcp::bench::GenericLeaseMgrBenchmark::~GenericLeaseMgrBenchmark
virtual ~GenericLeaseMgrBenchmark()
Virtual destructor.
Definition: generic_lease_mgr_benchmark.cc:44
isc::dhcp::bench::GenericLeaseMgrBenchmark::benchGetLease6_type_address
void benchGetLease6_type_address()
This step retrieves IPv6 leases by IP address.
Definition: generic_lease_mgr_benchmark.cc:204
isc::dhcp::bench::GenericLeaseMgrBenchmark::Universe
Universe
Specifies the IP protocol family to be bested.
Definition: generic_lease_mgr_benchmark.h:34
isc::dhcp::bench::GenericLeaseMgrBenchmark::V4
@ V4
Definition: generic_lease_mgr_benchmark.h:34
isc::dhcp::bench::GenericLeaseMgrBenchmark::V6
@ V6
Definition: generic_lease_mgr_benchmark.h:34
isc::dhcp::bench::GenericLeaseMgrBenchmark::setUp6
void setUp6(::benchmark::State &state, size_t const &lease_count)
set up code for initializing IPv6 version of a benchmark
Definition: generic_lease_mgr_benchmark.cc:66
isc::dhcp::bench::GenericLeaseMgrBenchmark::benchGetLease4_hwaddr_subnetid
void benchGetLease4_hwaddr_subnetid()
This step retrieves IPv4 leases by (hwaddr, subnet-id) tuple.
Definition: generic_lease_mgr_benchmark.cc:130
isc::dhcp::bench::GenericLeaseMgrBenchmark::prepareLeases6
void prepareLeases6(size_t const &lease_count)
Prepares specified number of IPv6 leases.
Definition: generic_lease_mgr_benchmark.cc:157
isc::dhcp::bench::GenericLeaseMgrBenchmark::setUp4
void setUp4(::benchmark::State &state, size_t const &lease_count)
set up code for initializing IPv4 version of a benchmark
Definition: generic_lease_mgr_benchmark.cc:48
isc::dhcp::bench::GenericLeaseMgrBenchmark::benchInsertLeases6
void benchInsertLeases6()
This step inserts all IPv6 leases stored in lease6_ into the LeaseMgr.
Definition: generic_lease_mgr_benchmark.cc:190
lease_mgr.h
An abstract API for lease database.
isc::dhcp::Lease6Collection
std::vector< Lease6Ptr > Lease6Collection
A collection of IPv6 leases.
Definition: lease.h:604
isc::dhcp::Lease4Collection
std::vector< Lease4Ptr > Lease4Collection
A collection of IPv4 leases.
Definition: lease.h:455
isc
Defines the logger used by the top-level component of kea-dhcp-ddns.
Definition: agent_parser.cc:144