Kea 2.7.6
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
39public:
40
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
100
102
105 boost::posix_time::ptime start_time_;
106};
107
108}
109}
110
111#endif
A message sending rate control class for perfdhcp.
boost::posix_time::ptime currentTime()
Convenience function returning current time.
RateControl()
Default constructor.
uint64_t total_pkts_sent_count_
Holds number of packets send from the beginning.
unsigned int getRate() const
Returns the rate.
unsigned int rate_
Holds a desired rate value.
void setRate(const int rate)
Sets the new rate.
uint64_t getOutboundMessageCount(bool const waiting_to_exit=false)
Returns number of messages to be sent "now".
boost::posix_time::ptime start_time_
Holds time of start of testing.
Defines the logger used by the top-level component of kea-lfc.