Kea 2.5.8
isc::perfdhcp::BasicScen Class Reference

Basic Scenario class. More...

#include <basic_scen.h>

+ Inheritance diagram for isc::perfdhcp::BasicScen:

Public Member Functions

 BasicScen (CommandOptions &options, BasePerfSocket &socket)
 Default and the only constructor of BasicScen.
 
int run () override
 brief\ Run performance test.
 
- Public Member Functions inherited from isc::perfdhcp::AbstractScen
 AbstractScen (CommandOptions &options, BasePerfSocket &socket)
 Default and the only constructor of AbstractScen.
 
virtual ~AbstractScen ()
 Trivial virtual destructor.
 
virtual int run ()=0
 Run performance test.
 

Protected Member Functions

bool checkExitConditions ()
 Check if test exit conditions fulfilled.
 

Protected Attributes

RateControl basic_rate_control_
 A rate control class for Discover and Solicit messages.
 
RateControl release_rate_control_
 A rate control class for Release messages.
 
RateControl renew_rate_control_
 A rate control class for Renew messages.
 
- Protected Attributes inherited from isc::perfdhcp::AbstractScen
CommandOptionsoptions_
 Reference to commandline options.
 
ExchangeType stage1_xchg_
 
ExchangeType stage2_xchg_
 
TestControl tc_
 Object for controlling sending and receiving packets.
 

Detailed Description

Basic Scenario class.

This class is used to run the performance test where DHCP server is continuously loaded with DHCP messages according to given rate.

Definition at line 23 of file basic_scen.h.

Constructor & Destructor Documentation

◆ BasicScen()

isc::perfdhcp::BasicScen::BasicScen ( CommandOptions options,
BasePerfSocket socket 
)
inline

Default and the only constructor of BasicScen.

Parameters
optionsreference to command options,
socketreference to a socket.

Definition at line 29 of file basic_scen.h.

References basic_rate_control_, isc::perfdhcp::CommandOptions::getRate(), isc::perfdhcp::CommandOptions::getReleaseRate(), isc::perfdhcp::CommandOptions::getRenewRate(), isc::perfdhcp::AbstractScen::options_, release_rate_control_, renew_rate_control_, and isc::perfdhcp::RateControl::setRate().

+ Here is the call graph for this function:

Member Function Documentation

◆ checkExitConditions()

bool isc::perfdhcp::BasicScen::checkExitConditions ( )
protected

Check if test exit conditions fulfilled.

Method checks if the test exit conditions are fulfilled. Exit conditions are checked periodically from the main loop. Program should break the main loop when this method returns true. It is calling function responsibility to break main loop gracefully and cleanup after test execution.

Returns
true if any of the exit conditions is fulfilled.

Definition at line 24 of file basic_scen.cc.

References isc::perfdhcp::StatsMgr::getDroppedPacketsNum(), isc::perfdhcp::CommandOptions::getMaxDrop(), isc::perfdhcp::CommandOptions::getMaxDropPercentage(), isc::perfdhcp::CommandOptions::getNumRequests(), isc::perfdhcp::CommandOptions::getPeriod(), isc::perfdhcp::StatsMgr::getSentPacketsNum(), isc::perfdhcp::TestControl::getStatsMgr(), isc::perfdhcp::StatsMgr::getTestPeriod(), isc::perfdhcp::TestControl::interrupted(), isc::perfdhcp::AbstractScen::options_, isc::perfdhcp::AbstractScen::stage1_xchg_, isc::perfdhcp::AbstractScen::stage2_xchg_, isc::perfdhcp::AbstractScen::tc_, isc::perfdhcp::CommandOptions::testDiags(), and isc::perfdhcp::TestControl::waitToExit().

Referenced by run().

+ Here is the call graph for this function:

◆ run()

int isc::perfdhcp::BasicScen::run ( )
overridevirtual

brief\ Run performance test.

Method runs whole performance test. Command line options must be parsed prior to running this function. Otherwise function will throw exception.

Exceptions
isc::InvalidOperationif command line options are not parsed.
isc::Unexpectedif internal Test Controller error occurred.
Returns
execution status.
Todo:
: need to implement adaptive time here, so the sleep time is not fixed, but adjusts to current situation.

Implements isc::perfdhcp::AbstractScen.

Definition at line 125 of file basic_scen.cc.

References basic_rate_control_, checkExitConditions(), isc::perfdhcp::TestControl::cleanCachedPackets(), isc::perfdhcp::TestControl::consumeReceivedPackets(), isc::dhcp::DHCPRELEASE, isc::dhcp::DHCPREQUEST, DHCPV6_RELEASE, DHCPV6_RENEW, isc::perfdhcp::StatsMgr::droppedPackets(), isc::perfdhcp::TestControl::exit_time_, isc::perfdhcp::CommandOptions::getIpVersion(), isc::perfdhcp::RateControl::getOutboundMessageCount(), isc::perfdhcp::CommandOptions::getPreload(), isc::perfdhcp::CommandOptions::getRate(), isc::perfdhcp::CommandOptions::getReleaseRate(), isc::perfdhcp::CommandOptions::getRenewRate(), isc::perfdhcp::CommandOptions::getReportDelay(), isc::perfdhcp::TestControl::getServerId(), isc::perfdhcp::TestControl::getStatsMgr(), isc::perfdhcp::CommandOptions::getWrapped(), isc::perfdhcp::StatsMgr::incrementCounter(), isc::perfdhcp::AbstractScen::options_, isc::perfdhcp::TestControl::printIntermediateStats(), isc::perfdhcp::StatsMgr::printLeases(), isc::perfdhcp::TestControl::printStats(), isc::perfdhcp::TestControl::printTemplates(), isc::perfdhcp::StatsMgr::printTimestamps(), release_rate_control_, renew_rate_control_, isc::perfdhcp::TestControl::runWrapped(), isc::perfdhcp::TestControl::sendMultipleMessages4(), isc::perfdhcp::TestControl::sendMultipleMessages6(), isc::perfdhcp::TestControl::sendPackets(), isc::perfdhcp::TestControl::serverIdReceived(), isc::perfdhcp::TestControl::start(), isc::perfdhcp::TestControl::stop(), isc::perfdhcp::AbstractScen::tc_, and isc::perfdhcp::CommandOptions::testDiags().

Referenced by main().

+ Here is the call graph for this function:

Member Data Documentation

◆ basic_rate_control_

RateControl isc::perfdhcp::BasicScen::basic_rate_control_
protected

A rate control class for Discover and Solicit messages.

Definition at line 50 of file basic_scen.h.

Referenced by BasicScen(), and run().

◆ release_rate_control_

RateControl isc::perfdhcp::BasicScen::release_rate_control_
protected

A rate control class for Release messages.

Definition at line 54 of file basic_scen.h.

Referenced by BasicScen(), and run().

◆ renew_rate_control_

RateControl isc::perfdhcp::BasicScen::renew_rate_control_
protected

A rate control class for Renew messages.

Definition at line 52 of file basic_scen.h.

Referenced by BasicScen(), and run().


The documentation for this class was generated from the following files: