![]() |
Kea 2.2.0
|
Memfile derivation of the IPv4 statistical lease data query. More...
Public Member Functions | |
MemfileLeaseStatsQuery4 (Lease4Storage &storage4) | |
Constructor for an all subnets query. More... | |
MemfileLeaseStatsQuery4 (Lease4Storage &storage4, const SubnetID &first_subnet_id, const SubnetID &last_subnet_id) | |
Constructor for a subnet range query. More... | |
MemfileLeaseStatsQuery4 (Lease4Storage &storage4, const SubnetID &subnet_id) | |
Constructor for a single subnet query. More... | |
virtual | ~MemfileLeaseStatsQuery4 () |
Destructor. More... | |
void | start () |
Creates the IPv4 lease statistical data result set. More... | |
![]() | |
MemfileLeaseStatsQuery () | |
Constructor for all subnets query. More... | |
MemfileLeaseStatsQuery (const SubnetID &first_subnet_id, const SubnetID &last_subnet_id) | |
Constructor for subnet range query. More... | |
MemfileLeaseStatsQuery (const SubnetID &subnet_id) | |
Constructor for single subnet query. More... | |
virtual | ~MemfileLeaseStatsQuery () |
Destructor. More... | |
virtual bool | getNextRow (LeaseStatsRow &row) |
Fetches the next row in the result set. More... | |
int | getRowCount () const |
Returns the number of rows in the result set. More... | |
![]() | |
LeaseStatsQuery () | |
Default constructor The query created will return statistics for all subnets. More... | |
LeaseStatsQuery (const SubnetID &first_subnet_id, const SubnetID &last_subnet_id) | |
Constructor to query for the stats for a range of subnets. More... | |
LeaseStatsQuery (const SubnetID &subnet_id) | |
Constructor to query for a single subnet's stats. More... | |
virtual | ~LeaseStatsQuery () |
virtual destructor More... | |
SubnetID | getFirstSubnetID () const |
Returns the value of first subnet ID specified (or zero) More... | |
SubnetID | getLastSubnetID () const |
Returns the value of last subnet ID specified (or zero) More... | |
virtual bool | getNextRow (LeaseStatsRow &row) |
Fetches the next row of data. More... | |
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. More... | |
virtual void | start () |
Executes the query. More... | |
Additional Inherited Members | |
![]() | |
enum | SelectMode { ALL_SUBNETS , SINGLE_SUBNET , SUBNET_RANGE } |
Defines the types of selection criteria supported. More... | |
![]() | |
std::vector< LeaseStatsRow >::iterator | next_pos_ |
An iterator for accessing the next row within the result set. More... | |
std::vector< LeaseStatsRow > | rows_ |
A vector containing the "result set". More... | |
![]() | |
SubnetID | first_subnet_id_ |
First (or only) subnet_id in the selection criteria. More... | |
SubnetID | last_subnet_id_ |
Last subnet_id in the selection criteria when a range is given. More... | |
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 331 of file memfile_lease_mgr.cc.
|
inline |
Constructor for an all subnets query.
storage4 | A pointer to the v4 lease storage to be counted |
Definition at line 336 of file memfile_lease_mgr.cc.
|
inline |
Constructor for a single subnet query.
storage4 | A pointer to the v4 lease storage to be counted |
subnet_id | ID of the desired subnet |
Definition at line 344 of file memfile_lease_mgr.cc.
|
inline |
Constructor for a subnet range query.
storage4 | A pointer to the v4 lease storage to be counted |
first_subnet_id | ID of the first subnet in the desired range |
last_subnet_id | ID of the last subnet in the desired range |
Definition at line 353 of file memfile_lease_mgr.cc.
|
inlinevirtual |
Destructor.
Definition at line 359 of file memfile_lease_mgr.cc.
|
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 address, accumulating the lease state counts per subnet. At the completion of all entries for a given subnet, 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.
Currently the states counted are:
Reimplemented from isc::dhcp::LeaseStatsQuery.
Definition at line 375 of file memfile_lease_mgr.cc.
References isc::dhcp::LeaseStatsQuery::ALL_SUBNETS, isc::dhcp::LeaseStatsQuery::getFirstSubnetID(), isc::dhcp::LeaseStatsQuery::getLastSubnetID(), isc::dhcp::LeaseStatsQuery::getSelectMode(), isc::dhcp::MemfileLeaseStatsQuery::next_pos_, isc::dhcp::MemfileLeaseStatsQuery::rows_, isc::dhcp::LeaseStatsQuery::SINGLE_SUBNET, isc::dhcp::Lease::STATE_DECLINED, isc::dhcp::Lease::STATE_DEFAULT, and isc::dhcp::LeaseStatsQuery::SUBNET_RANGE.