Kea
1.9.9-git
|
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 &subnet_id) | |
Constructor for a single subnet query. More... | |
MemfileLeaseStatsQuery4 (Lease4Storage &storage4, const SubnetID &first_subnet_id, const SubnetID &last_subnet_id) | |
Constructor for a subnet range query. More... | |
virtual | ~MemfileLeaseStatsQuery4 () |
Destructor. More... | |
void | start () |
Creates the IPv4 lease statistical data result set. More... | |
Public Member Functions inherited from isc::dhcp::MemfileLeaseStatsQuery | |
MemfileLeaseStatsQuery () | |
Constructor for all subnets query. More... | |
MemfileLeaseStatsQuery (const SubnetID &subnet_id) | |
Constructor for single subnet query. More... | |
MemfileLeaseStatsQuery (const SubnetID &first_subnet_id, const SubnetID &last_subnet_id) | |
Constructor for subnet range 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... | |
Public Member Functions inherited from isc::dhcp::LeaseStatsQuery | |
LeaseStatsQuery () | |
Default constructor The query created will return statistics for all subnets. More... | |
LeaseStatsQuery (const SubnetID &subnet_id) | |
Constructor to query for a single subnet's stats. More... | |
LeaseStatsQuery (const SubnetID &first_subnet_id, const SubnetID &last_subnet_id) | |
Constructor to query for the stats for a range of subnets. 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... | |
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... | |
Additional Inherited Members | |
Public Types inherited from isc::dhcp::LeaseStatsQuery | |
enum | SelectMode { ALL_SUBNETS, SINGLE_SUBNET, SUBNET_RANGE } |
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. More... | |
std::vector< LeaseStatsRow > | rows_ |
A vector containing the "result set". More... | |
Protected Attributes inherited from isc::dhcp::LeaseStatsQuery | |
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 327 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 332 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 340 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 349 of file memfile_lease_mgr.cc.
|
inlinevirtual |
Destructor.
Definition at line 355 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 371 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.