Kea: lease_file_stats.h Source File

| Kea 3.2.0-git

lease_file_stats.h
Go to the documentation of this file.
1// Copyright (C) 2015-2017 Internet Systems Consortium, Inc. ("ISC")
2//
3// This Source Code Form is subject to the terms of the Mozilla Public
4// License, v. 2.0. If a copy of the MPL was not distributed with this
5// file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
7#ifndef LEASE_FILE_STATS_H
8#define LEASE_FILE_STATS_H
9
10namespace isc {
11namespace dhcp {
12
18 class LeaseFileStats {
19public:
23 LeaseFileStats() {
24 clearStatistics();
25 }
26
28 ~LeaseFileStats() {
29 }
30
32 uint32_t getReads() const {
33 return (reads_);
34 }
35
37 uint32_t getReadLeases() const {
38 return (read_leases_);
39 }
40
42 uint32_t getReadErrs() const {
43 return (read_errs_);
44 }
45
47 uint32_t getWrites() const {
48 return (writes_);
49 }
50
52 uint32_t getWriteLeases() const {
53 return (write_leases_);
54 }
55
57 uint32_t getWriteErrs() const {
58 return (write_errs_);
59 }
60
62 void clearStatistics() {
63 reads_ = 0;
64 read_leases_ = 0;
65 read_errs_ = 0;
66 writes_ = 0;
67 write_leases_ = 0;
68 write_errs_ = 0;
69 }
70
71protected:
73 uint32_t reads_;
74
76 uint32_t read_leases_;
77
79 uint32_t read_errs_;
80
82 uint32_t writes_;
83
85 uint32_t write_leases_;
86
88 uint32_t write_errs_;
89};
90
91} // namespace dhcp
92} // namespace isc
93
94#endif // LEASE_FILE_STATS_H
isc::dhcp::LeaseFileStats::getWriteErrs
uint32_t getWriteErrs() const
Gets the number of errors when writing leases.
Definition lease_file_stats.h:57
isc::dhcp::LeaseFileStats::~LeaseFileStats
~LeaseFileStats()
Destructor.
Definition lease_file_stats.h:28
isc::dhcp::LeaseFileStats::getReadLeases
uint32_t getReadLeases() const
Gets the number of leases read.
Definition lease_file_stats.h:37
isc::dhcp::LeaseFileStats::LeaseFileStats
LeaseFileStats()
Constructor.
Definition lease_file_stats.h:23
isc::dhcp::LeaseFileStats::write_leases_
uint32_t write_leases_
Number of lease written.
Definition lease_file_stats.h:85
isc::dhcp::LeaseFileStats::getWriteLeases
uint32_t getWriteLeases() const
Gets the number of leases written.
Definition lease_file_stats.h:52
isc::dhcp::LeaseFileStats::getReadErrs
uint32_t getReadErrs() const
Gets the number of errors when reading leases.
Definition lease_file_stats.h:42
isc::dhcp::LeaseFileStats::read_leases_
uint32_t read_leases_
Number of leases read.
Definition lease_file_stats.h:76
isc::dhcp::LeaseFileStats::reads_
uint32_t reads_
Number of attempts to read a lease.
Definition lease_file_stats.h:73
isc::dhcp::LeaseFileStats::clearStatistics
void clearStatistics()
Clears the statistics.
Definition lease_file_stats.h:62
isc::dhcp::LeaseFileStats::writes_
uint32_t writes_
Number of attempts to write a lease.
Definition lease_file_stats.h:82
isc::dhcp::LeaseFileStats::getWrites
uint32_t getWrites() const
Gets the number of attempts to write a lease.
Definition lease_file_stats.h:47
isc::dhcp::LeaseFileStats::write_errs_
uint32_t write_errs_
Number of errors when writing.
Definition lease_file_stats.h:88
isc::dhcp::LeaseFileStats::read_errs_
uint32_t read_errs_
Number of errors when reading.
Definition lease_file_stats.h:79
isc::dhcp::LeaseFileStats::getReads
uint32_t getReads() const
Gets the number of attempts to read a lease.
Definition lease_file_stats.h:32
isc::dhcp
Definition dhcp4/client_handler.cc:20
isc
Defines the logger used by the top-level component of kea-lfc.
Definition check_exists_add.cc:18