37 GenericLeaseMgrBenchmark::GenericLeaseMgrBenchmark() : lmptr_(NULL) {
53 size_t const& lease_count) {
71 size_t const& lease_count) {
82 for (
size_t i = 0x0001u; i < 0x0001u + lease_count; ++i) {
87 lease->valid_lft_ = i;
89 lease->subnet_id_ = i;
90 lease->fqdn_rev_ = (i % 2) ?
true :
false;
91 lease->fqdn_fwd_ = (i % 2) ?
true :
false;
92 lease->hostname_ = to_string(i) +
".host.com";
154 if (lease_count > 0xfffdu) {
155 cerr <<
"lease_count <= 0xfffd or change address generation in "
156 "GenericLeaseMgrBenchmark::prepareLeases6()"
160 for (
size_t i = 0x0001u; i < 0x0001u + lease_count; ++i) {
165 const string prefix = string(
"2001:db8::") + n_lease;
169 lease->prefixlen_ = i % 128;
171 lease->duid_ =
DuidPtr(
new DUID(vector<uint8_t>(8, i)));
172 lease->preferred_lft_ = i;
173 lease->valid_lft_ = i;
175 lease->subnet_id_ = i;
176 lease->fqdn_fwd_ = (i % 2 == 0) ?
true :
false;
177 lease->fqdn_rev_ = (i % 2 == 0) ?
true :
false;
178 lease->hostname_ = n_lease +
".host.com";
boost::shared_ptr< DUID > DuidPtr
virtual void updateLease4(const Lease4Ptr &lease4)=0
Updates IPv4 lease.
void benchGetLease6_type_duid_iaid_subnetid()
This step retrieves IPv6 leases by (type, duid, iaid, subnet-id) tuple.
Structure that holds a lease for IPv4 address.
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.
void benchGetLease4_clientid()
This step retrieves IPv4 leases by client-id.
std::vector< Lease4Ptr > Lease4Collection
A collection of IPv4 leases.
Lease6Collection leases6_
List of IPv6 leases (useful during benchmarks)
Holds DUID (DHCPv6 Unique Identifier)
virtual void getExpiredLeases6(Lease6Collection &expired_leases, const size_t max_leases) const =0
Returns a collection of expired DHCPv6 leases.
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.
boost::shared_ptr< Lease4 > Lease4Ptr
Pointer to a Lease4 structure.
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.
Structure that holds a lease for IPv6 address and/or prefix.
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.
void benchGetLease6_type_duid_iaid()
This step retrieves IPv6 leases by (type, duid, iaid) tuple.
virtual Lease6Ptr getLease6(Lease::Type type, const isc::asiolink::IOAddress &addr) const =0
Returns existing IPv6 lease for a given IPv6 address.
boost::shared_ptr< ClientId > ClientIdPtr
Shared pointer to a Client ID.
void benchGetLease4_clientid_subnetid()
This step retrieves IPv4 leases by (client-id, subnet-id) tuple.
virtual void getExpiredLeases4(Lease4Collection &expired_leases, const size_t max_leases) const =0
Returns a collection of expired DHCPv4 leases.
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.
Type
Type of lease or pool.
Holds Client identifier or client IPv4 address.
Hardware type that represents information from DHCPv4 packet.
virtual bool addLease(const Lease4Ptr &lease)=0
Adds an IPv4 lease.
virtual Lease4Ptr getLease4(const isc::asiolink::IOAddress &addr) const =0
Returns an IPv4 lease for specified IPv4 address.
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.
The IOAddress class represents an IP addresses (version agnostic)
virtual Lease6Collection getLeases6(Lease::Type type, const DUID &duid, uint32_t iaid) const =0
Returns existing IPv6 leases for a given DUID+IA combination.
virtual ~GenericLeaseMgrBenchmark()
Virtual destructor.
boost::shared_ptr< Lease6 > Lease6Ptr
Pointer to a Lease6 structure.
virtual void updateLease6(const Lease6Ptr &lease6)=0
Updates IPv6 lease.
void setUp4(::benchmark::State &state, size_t const &lease_count)
set up code for initializing IPv4 version of a benchmark