11#include <boost/date_time/posix_time/posix_time.hpp>
14using namespace boost::posix_time;
36 std::cout <<
"reached test-period." << std::endl;
44 bool max_requests =
false;
61 std::cout <<
"Reached max requests limit." << std::endl;
69 bool max_drops =
false;
85 std::cout <<
"Reached maximum drops number." << std::endl;
93 bool max_pdrops =
false;
115 std::cout <<
"Reached maximum percentage of drops." << std::endl;
143 uint64_t packets_due =
156 if (
options_.
getRate() < 10000 && packets_due == 0 && pkt_count == 0) {
175 uint64_t renew_packets_due =
189 uint64_t release_packets_due =
236 std::cout <<
"Interrupted" << std::endl;
TestControl tc_
Object for controlling sending and receiving packets.
ExchangeType stage2_xchg_
CommandOptions & options_
Reference to commandline options.
ExchangeType stage1_xchg_
RateControl renew_rate_control_
A rate control class for Renew messages.
int run() override
brief\ Run performance test.
bool checkExitConditions()
Check if test exit conditions fulfilled.
RateControl release_rate_control_
A rate control class for Release messages.
RateControl basic_rate_control_
A rate control class for Discover and Solicit messages.
bool testDiags(const char diag)
Find if diagnostic flag has been set.
std::string getWrapped() const
Returns wrapped command.
int getRenewRate() const
Returns a rate at which DHCPv6 Renew messages are sent.
uint8_t getIpVersion() const
Returns IP version.
int getRate() const
Returns exchange rate.
int getReportDelay() const
Returns delay between two performance reports.
std::vector< double > getMaxDropPercentage() const
Returns maximal percentage of drops.
std::vector< int > getNumRequests() const
Returns maximum number of exchanges.
int getPreload() const
Returns number of preload exchanges.
std::vector< int > getMaxDrop() const
Returns maximum drops number.
int getPeriod() const
Returns test period.
int getReleaseRate() const
Returns a rate at which DHCPv6 Release messages are sent.
uint64_t getOutboundMessageCount(bool const waiting_to_exit=false)
Returns number of messages to be sent "now".
void printLeases() const
Delegate to all exchanges to print their leases.
uint64_t getDroppedPacketsNum(const ExchangeType xchg_type) const
Return total number of dropped packets.
const CustomCounter & incrementCounter(const std::string &counter_key, const uint64_t value=1)
Increment specified counter.
void printTimestamps() const
Print timestamps of all packets.
uint64_t getSentPacketsNum(const ExchangeType xchg_type) const
Return total number of sent packets.
boost::posix_time::time_period getTestPeriod() const
Get time period since the start of test.
bool droppedPackets() const
Check if any packet drops occurred.
bool waitToExit()
Delay the exit by a fixed given time to catch up to all exchanges that were already started.
bool interrupted() const
Get interrupted flag.
std::string getServerId() const
Get received server id.
uint64_t sendMultipleMessages4(const uint32_t msg_type, const uint64_t msg_num)
Send number of DHCPREQUEST (renew) messages to a server.
boost::posix_time::ptime exit_time_
Initialized at first exit condition with the time perfdhcp should exit.
uint64_t sendMultipleMessages6(const uint32_t msg_type, const uint64_t msg_num)
Send number of DHCPv6 Renew or Release messages to the server.
void start()
Start receiver.
void cleanCachedPackets()
Removes cached DHCPv6 Reply packets every second.
StatsMgr & getStatsMgr()
Get stats manager.
void sendPackets(const uint64_t packets_num, const bool preload=false)
Send number of packets to initiate new exchanges.
void stop()
Stop receiver.
void runWrapped(bool do_stop=false) const
Run wrapped command.
void printTemplates() const
Print templates information.
unsigned int consumeReceivedPackets()
Pull packets from receiver and process them.
void printStats() const
Print performance statistics.
bool serverIdReceived() const
Get received server id flag.
void printIntermediateStats()
Print intermediate statistics.
Defines the logger used by the top-level component of kea-lfc.