Kea 2.5.9
isc::dhcp::MemfileLeaseStatsQuery4 Class Reference

Memfile derivation of the IPv4 statistical lease data query. More...

+ Inheritance diagram for isc::dhcp::MemfileLeaseStatsQuery4:

Public Member Functions

 MemfileLeaseStatsQuery4 (Lease4Storage &storage4, const SelectMode &select_mode=ALL_SUBNETS)
 Constructor for an all subnets query.
 
 MemfileLeaseStatsQuery4 (Lease4Storage &storage4, const SubnetID &first_subnet_id, const SubnetID &last_subnet_id)
 Constructor for a subnet range query.
 
 MemfileLeaseStatsQuery4 (Lease4Storage &storage4, const SubnetID &subnet_id)
 Constructor for a single subnet query.
 
virtual ~MemfileLeaseStatsQuery4 ()
 Destructor.
 
void start ()
 Creates the IPv4 lease statistical data result set.
 
- Public Member Functions inherited from isc::dhcp::MemfileLeaseStatsQuery
 MemfileLeaseStatsQuery (const SelectMode &select_mode=ALL_SUBNETS)
 Constructor for all subnets query.
 
 MemfileLeaseStatsQuery (const SubnetID &first_subnet_id, const SubnetID &last_subnet_id)
 Constructor for subnet range query.
 
 MemfileLeaseStatsQuery (const SubnetID &subnet_id)
 Constructor for single subnet query.
 
virtual ~MemfileLeaseStatsQuery ()
 Destructor.
 
virtual bool getNextRow (LeaseStatsRow &row)
 Fetches the next row in the result set.
 
int getRowCount () const
 Returns the number of rows in the result set.
 
- Public Member Functions inherited from isc::dhcp::LeaseStatsQuery
 LeaseStatsQuery (const SelectMode &select_mode=ALL_SUBNETS)
 Constructor to query statistics for all subnets.
 
 LeaseStatsQuery (const SubnetID &first_subnet_id, const SubnetID &last_subnet_id)
 Constructor to query for the stats for a range of subnets.
 
 LeaseStatsQuery (const SubnetID &subnet_id)
 Constructor to query for a single subnet's stats.
 
virtual ~LeaseStatsQuery ()
 virtual destructor
 
SubnetID getFirstSubnetID () const
 Returns the value of first subnet ID specified (or zero)
 
SubnetID getLastSubnetID () const
 Returns the value of last subnet ID specified (or zero)
 
virtual bool getNextRow (LeaseStatsRow &row)
 Fetches the next row of data.
 
SelectMode getSelectMode () const
 Returns the selection criteria mode The value returned is based upon the constructor variant used and it indicates which query variant will be executed.
 
virtual void start ()
 Executes the query.
 

Additional Inherited Members

- Public Types inherited from isc::dhcp::LeaseStatsQuery
enum  SelectMode { ALL_SUBNETS , SINGLE_SUBNET , SUBNET_RANGE , ALL_SUBNET_POOLS }
 Defines the types of selection criteria supported. More...
 
- Protected Attributes inherited from isc::dhcp::MemfileLeaseStatsQuery
std::vector< LeaseStatsRow >::iterator next_pos_
 An iterator for accessing the next row within the result set.
 
std::vector< LeaseStatsRowrows_
 A vector containing the "result set".
 
- Protected Attributes inherited from isc::dhcp::LeaseStatsQuery
SubnetID first_subnet_id_
 First (or only) subnet_id in the selection criteria.
 
SubnetID last_subnet_id_
 Last subnet_id in the selection criteria when a range is given.
 

Detailed Description

Memfile derivation of the IPv4 statistical lease data query.

This class is used to recalculate IPv4 lease statistics for Memfile lease storage. It does so by iterating over the given storage, accumulating counts of leases in each of the monitored lease states for each subnet and storing these counts in an internal collection. The populated result set will contain one entry per monitored state per subnet.

Definition at line 335 of file memfile_lease_mgr.cc.

Constructor & Destructor Documentation

◆ MemfileLeaseStatsQuery4() [1/3]

isc::dhcp::MemfileLeaseStatsQuery4::MemfileLeaseStatsQuery4 ( Lease4Storage storage4,
const SelectMode select_mode = ALL_SUBNETS 
)
inline

Constructor for an all subnets query.

Parameters
storage4A pointer to the v4 lease storage to be counted
select_modeThe selection criteria which is either ALL_SUBNETS or ALL_SUBNET_POOLS

Definition at line 342 of file memfile_lease_mgr.cc.

◆ MemfileLeaseStatsQuery4() [2/3]

isc::dhcp::MemfileLeaseStatsQuery4::MemfileLeaseStatsQuery4 ( Lease4Storage storage4,
const SubnetID subnet_id 
)
inline

Constructor for a single subnet query.

Parameters
storage4A pointer to the v4 lease storage to be counted
subnet_idID of the desired subnet

Definition at line 351 of file memfile_lease_mgr.cc.

◆ MemfileLeaseStatsQuery4() [3/3]

isc::dhcp::MemfileLeaseStatsQuery4::MemfileLeaseStatsQuery4 ( Lease4Storage storage4,
const SubnetID first_subnet_id,
const SubnetID last_subnet_id 
)
inline

Constructor for a subnet range query.

Parameters
storage4A pointer to the v4 lease storage to be counted
first_subnet_idID of the first subnet in the desired range
last_subnet_idID of the last subnet in the desired range

Definition at line 360 of file memfile_lease_mgr.cc.

◆ ~MemfileLeaseStatsQuery4()

virtual isc::dhcp::MemfileLeaseStatsQuery4::~MemfileLeaseStatsQuery4 ( )
inlinevirtual

Destructor.

Definition at line 366 of file memfile_lease_mgr.cc.

Member Function Documentation

◆ start()

void isc::dhcp::MemfileLeaseStatsQuery4::start ( )
inlinevirtual

Creates the IPv4 lease statistical data result set.

The result set is populated by iterating over the IPv4 leases in storage, in ascending order by subnet id or by subnet id and pool id, accumulating the lease state counts per subnet or per subnet and pool. At the completion of all entries for a given subnet or pool, the counts are used to create LeaseStatsRow instances which are appended to an internal vector. The process results in a vector containing one entry per state per subnet or per subnet and pool.

Currently the states counted are:

Reimplemented from isc::dhcp::LeaseStatsQuery.

Definition at line 382 of file memfile_lease_mgr.cc.

References isc::dhcp::LeaseStatsQuery::ALL_SUBNET_POOLS, isc::dhcp::LeaseStatsQuery::ALL_SUBNETS, isc::dhcp::LeaseStatsQuery::getSelectMode(), isc::dhcp::LeaseStatsQuery::SINGLE_SUBNET, and isc::dhcp::LeaseStatsQuery::SUBNET_RANGE.

+ Here is the call graph for this function:

The documentation for this class was generated from the following file: