Kea: rate_control.h Source File

| Kea 3.0.0

rate_control.h
Go to the documentation of this file.
1// Copyright (C) 2013-2019 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 RATE_CONTROL_H
8#define RATE_CONTROL_H
9
10#include <boost/date_time/posix_time/posix_time.hpp>
11
12namespace isc {
13namespace perfdhcp {
14
38 class RateControl {
39public:
40
42 RateControl();
43
47 RateControl(const unsigned int rate);
48
72 uint64_t getOutboundMessageCount(bool const waiting_to_exit = false);
73
75 unsigned int getRate() const {
76 return (rate_);
77 }
78
83 void setRate(const int rate);
84
85protected:
86
90 boost::posix_time::ptime currentTime();
91
93 unsigned int rate_;
94
96
99 uint64_t total_pkts_sent_count_;
100
102
105 boost::posix_time::ptime start_time_;
106};
107
108}
109}
110
111#endif
isc::perfdhcp::RateControl::currentTime
boost::posix_time::ptime currentTime()
Convenience function returning current time.
Definition rate_control.cc:66
isc::perfdhcp::RateControl::RateControl
RateControl()
Default constructor.
Definition rate_control.cc:19
isc::perfdhcp::RateControl::total_pkts_sent_count_
uint64_t total_pkts_sent_count_
Holds number of packets send from the beginning.
Definition rate_control.h:99
isc::perfdhcp::RateControl::getRate
unsigned int getRate() const
Returns the rate.
Definition rate_control.h:75
isc::perfdhcp::RateControl::rate_
unsigned int rate_
Holds a desired rate value.
Definition rate_control.h:93
isc::perfdhcp::RateControl::setRate
void setRate(const int rate)
Sets the new rate.
Definition rate_control.cc:71
isc::perfdhcp::RateControl::getOutboundMessageCount
uint64_t getOutboundMessageCount(bool const waiting_to_exit=false)
Returns number of messages to be sent "now".
Definition rate_control.cc:28
isc::perfdhcp::RateControl::start_time_
boost::posix_time::ptime start_time_
Holds time of start of testing.
Definition rate_control.h:105
isc::perfdhcp
Definition abstract_scen.h:15
isc
Defines the logger used by the top-level component of kea-lfc.
Definition agent_parser.cc:148