Kea  1.9.9-git
generic_lease_mgr_benchmark.h
Go to the documentation of this file.
1 // Copyright (C) 2018-2019 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 
25 namespace isc {
26 namespace dhcp {
27 namespace bench {
28 
30 class GenericLeaseMgrBenchmark : public benchmark::Fixture {
31 public:
33  enum Universe { V4, V6 };
34 
37 
39  virtual ~GenericLeaseMgrBenchmark();
40 
45  void setUp4(::benchmark::State& state, size_t const& lease_count);
46 
52  void setUpWithInserts4(::benchmark::State& state, size_t const& lease_count);
53 
58  void setUp6(::benchmark::State& state, size_t const& lease_count);
59 
65  void setUpWithInserts6(::benchmark::State& state, size_t const& lease_count);
66 
71  void prepareLeases4(size_t const& lease_count);
72 
74  void benchInsertLeases4();
75 
77  void benchUpdateLeases4();
78 
81 
83  void benchGetLease4_hwaddr();
84 
87 
90 
93 
96 
101  void prepareLeases6(size_t const& lease_count);
102 
104  void benchInsertLeases6();
105 
107  void benchUpdateLeases6();
108 
111 
114 
117 
119  void benchGetExpiredLeases6();
120 
123 
126 
129 };
130 
131 } // namespace bench
132 } // namespace dhcp
133 } // namespace isc
134 
135 #endif
void benchGetLease6_type_duid_iaid_subnetid()
This step retrieves IPv6 leases by (type, duid, iaid, subnet-id) tuple.
void benchGetLease4_address()
This step retrieves IPv4 leases by IP address.
void benchInsertLeases4()
This step inserts all IPv4 leases stored in lease4_ into the LeaseMgr.
Abstract Lease Manager.
Definition: lease_mgr.h:222
An abstract API for lease database.
void benchGetLease4_clientid()
This step retrieves IPv4 leases by client-id.
std::vector< Lease4Ptr > Lease4Collection
A collection of IPv4 leases.
Definition: lease.h:487
Lease6Collection leases6_
List of IPv6 leases (useful during benchmarks)
void benchGetExpiredLeases6()
This step retrieves all expired IPv6 leases.
void setUp6(::benchmark::State &state, size_t const &lease_count)
set up code for initializing IPv6 version of a benchmark
void benchGetLease4_hwaddr_subnetid()
This step retrieves IPv4 leases by (hwaddr, subnet-id) tuple.
void benchUpdateLeases4()
This step updates all IPv4 leases stored in lease4_ in the LeaseMgr.
Lease4Collection leases4_
List of IPv4 leases (useful during benchmarks)
void benchUpdateLeases6()
This step updates all IPv6 leases stored in lease6_ in the LeaseMgr.
void prepareLeases4(size_t const &lease_count)
Prepares specified number of IPv4 leases.
void benchGetLease4_hwaddr()
This step retrieves IPv4 leases by hardware address.
void benchInsertLeases6()
This step inserts all IPv6 leases stored in lease6_ into the LeaseMgr.
std::vector< Lease6Ptr > Lease6Collection
A collection of IPv6 leases.
Definition: lease.h:640
void benchGetLease6_type_duid_iaid()
This step retrieves IPv6 leases by (type, duid, iaid) tuple.
void benchGetLease4_clientid_subnetid()
This step retrieves IPv4 leases by (client-id, subnet-id) tuple.
void setUpWithInserts4(::benchmark::State &state, size_t const &lease_count)
set up code (with lease preinsertion) for initializing IPv4 version of a benchmark.
void setUpWithInserts6(::benchmark::State &state, size_t const &lease_count)
set up code (with lease preinsertion) for initializing IPv6 version of a benchmark.
Defines the logger used by the top-level component of kea-dhcp-ddns.
void prepareLeases6(size_t const &lease_count)
Prepares specified number of IPv6 leases.
A base class for a fixture for specific lease manager benchmarks.
Universe
Specifies the IP protocol family to be bested.
void benchGetLease6_type_address()
This step retrieves IPv6 leases by IP address.
LeaseMgr * lmptr_
Pointer to the lease manager being under evaluation.
void benchGetExpiredLeases4()
This step retrieves all expired IPv4 leases.
void setUp4(::benchmark::State &state, size_t const &lease_count)
set up code for initializing IPv4 version of a benchmark