Kea 2.5.9
isc::perfmon::PerfMonConfig Class Reference

Houses the PerfMon configuration parameters for a single scope (e.g. More...

#include <perfmon_config.h>

+ Inheritance diagram for isc::perfmon::PerfMonConfig:

Public Member Functions

 PerfMonConfig (uint16_t family)
 Constructor.
 
virtual ~PerfMonConfig ()=default
 Destructor.
 
uint32_t getAlarmReportSecs () const
 Fetches the value of alarm-report-secs.
 
AlarmStorePtr getAlarmStore ()
 Get the alarm store.
 
bool getEnableMonitoring () const
 Fetches the value of enable-monitoring.
 
uint16_t getFamily ()
 Get protocol family.
 
uint32_t getIntervalWidthSecs () const
 Fetches the value of interval-width-secs.
 
bool getStatsMgrReporting () const
 Fetches the value of stats-mgr-reporting.
 
void parse (data::ConstElementPtr config)
 Extracts member values from an Element::map.
 
void parseAlarms (data::ConstElementPtr config)
 Re-creates the AlarmStore and populates it by parsing a list of alarm elements.
 
void setAlarmReportSecs (uint32_t value)
 Sets the value of alarm-report-secs.
 
void setEnableMonitoring (bool value)
 Sets the value of enable-monitoring.
 
void setIntervalWidthSecs (uint32_t value)
 Sets the value of interval-width-secs.
 
void setStatsMgrReporting (bool value)
 Sets the value of stats-mgr-reporting.
 

Static Public Attributes

static const data::SimpleKeywords CONFIG_KEYWORDS
 List of valid parameters and expected types.
 
static const data::SimpleDefaults SIMPLE_DEFAULTS
 List of valid parameter defaults.
 

Protected Attributes

uint32_t alarm_report_secs_
 Number of seconds between reports of a raised alarm.
 
AlarmStorePtr alarm_store_
 Stores the configured alarms.
 
bool enable_monitoring_
 If true, performance data is processed/reported.
 
uint16_t family_
 Protocol family AF_INET or AF_INET6.
 
uint32_t interval_width_secs_
 Number of seconds a duration accumulates samples until reporting.
 
bool stats_mgr_reporting_
 If true durations report to StatsMgr at the end of each interval.
 

Detailed Description

Houses the PerfMon configuration parameters for a single scope (e.g.

global, subnet...);

Definition at line 133 of file perfmon_config.h.

Constructor & Destructor Documentation

◆ PerfMonConfig()

isc::perfmon::PerfMonConfig::PerfMonConfig ( uint16_t  family)
explicit

Constructor.

Definition at line 267 of file perfmon_config.cc.

References alarm_store_, family_, and isc_throw.

◆ ~PerfMonConfig()

virtual isc::perfmon::PerfMonConfig::~PerfMonConfig ( )
virtualdefault

Destructor.

Member Function Documentation

◆ getAlarmReportSecs()

uint32_t isc::perfmon::PerfMonConfig::getAlarmReportSecs ( ) const
inline

Fetches the value of alarm-report-secs.

Returns
integer value of alarm-report-secs.

Definition at line 208 of file perfmon_config.h.

References alarm_report_secs_.

◆ getAlarmStore()

AlarmStorePtr isc::perfmon::PerfMonConfig::getAlarmStore ( )
inline

Get the alarm store.

Returns
pointer to the alarm store.

Definition at line 229 of file perfmon_config.h.

References alarm_store_.

◆ getEnableMonitoring()

bool isc::perfmon::PerfMonConfig::getEnableMonitoring ( ) const
inline

Fetches the value of enable-monitoring.

Returns
boolean value of enable-monitoring.

Definition at line 166 of file perfmon_config.h.

References enable_monitoring_.

◆ getFamily()

uint16_t isc::perfmon::PerfMonConfig::getFamily ( )
inline

Get protocol family.

Returns
uint16_t containing the family (AF_INET or AF_INET6).

Definition at line 222 of file perfmon_config.h.

References family_.

◆ getIntervalWidthSecs()

uint32_t isc::perfmon::PerfMonConfig::getIntervalWidthSecs ( ) const
inline

Fetches the value of interval-width-secs.

Returns
integer value of interval-width-secs.

Definition at line 180 of file perfmon_config.h.

References interval_width_secs_.

◆ getStatsMgrReporting()

bool isc::perfmon::PerfMonConfig::getStatsMgrReporting ( ) const
inline

Fetches the value of stats-mgr-reporting.

Returns
boolean value of stats-mgr-reporting.

Definition at line 194 of file perfmon_config.h.

References stats_mgr_reporting_.

Referenced by isc::perfmon::PerfMonMgr::reportToStatsMgr().

◆ parse()

void isc::perfmon::PerfMonConfig::parse ( data::ConstElementPtr  config)

Extracts member values from an Element::map.

Parameters
configmap of configuration parameters.
Exceptions
DhcpConfigErrorif invalid values are detected.

Definition at line 281 of file perfmon_config.cc.

References isc::data::SimpleParser::checkKeywords(), CONFIG_KEYWORDS, family_, isc_throw, parseAlarms(), setAlarmReportSecs(), setEnableMonitoring(), setIntervalWidthSecs(), and setStatsMgrReporting().

Referenced by isc::perfmon::PerfMonMgr::configure().

+ Here is the call graph for this function:

◆ parseAlarms()

void isc::perfmon::PerfMonConfig::parseAlarms ( data::ConstElementPtr  config)

Re-creates the AlarmStore and populates it by parsing a list of alarm elements.

Parameters
configlist of alarm configuration elements.
Exceptions
DhcpConfigErrorif a parsing error occurs or there are duplicate alarm keys.

Definition at line 332 of file perfmon_config.cc.

References alarm_store_, family_, isc_throw, isc::perfmon::AlarmParser::parse(), and isc::Exception::what().

Referenced by parse().

+ Here is the call graph for this function:

◆ setAlarmReportSecs()

void isc::perfmon::PerfMonConfig::setAlarmReportSecs ( uint32_t  value)
inline

Sets the value of alarm-report-secs.

Parameters
valuenew value for alarm-report-secs.

Definition at line 215 of file perfmon_config.h.

References alarm_report_secs_.

Referenced by parse().

◆ setEnableMonitoring()

void isc::perfmon::PerfMonConfig::setEnableMonitoring ( bool  value)
inline

Sets the value of enable-monitoring.

Parameters
valuenew value for enable-monitoring.

Definition at line 173 of file perfmon_config.h.

References enable_monitoring_.

Referenced by isc::perfmon::PerfMonMgr::configure(), and parse().

◆ setIntervalWidthSecs()

void isc::perfmon::PerfMonConfig::setIntervalWidthSecs ( uint32_t  value)
inline

Sets the value of interval-width-secs.

Parameters
valuenew value for interval-width-secs.

Definition at line 187 of file perfmon_config.h.

References interval_width_secs_.

Referenced by parse().

◆ setStatsMgrReporting()

void isc::perfmon::PerfMonConfig::setStatsMgrReporting ( bool  value)
inline

Sets the value of stats-mgr-reporting.

Parameters
valuenew value for stats-mgr-reporting.

Definition at line 201 of file perfmon_config.h.

References stats_mgr_reporting_.

Referenced by parse().

Member Data Documentation

◆ alarm_report_secs_

uint32_t isc::perfmon::PerfMonConfig::alarm_report_secs_
protected

Number of seconds between reports of a raised alarm.

Defaults to 300. A value of zero disables alarms.

Definition at line 253 of file perfmon_config.h.

Referenced by getAlarmReportSecs(), isc::perfmon::PerfMonMgr::init(), and setAlarmReportSecs().

◆ alarm_store_

AlarmStorePtr isc::perfmon::PerfMonConfig::alarm_store_
protected

◆ CONFIG_KEYWORDS

const data::SimpleKeywords isc::perfmon::PerfMonConfig::CONFIG_KEYWORDS
static
Initial value:
=
{
{"enable-monitoring", Element::boolean},
{"interval-width-secs", Element::integer},
{"stats-mgr-reporting", Element::boolean},
{"alarm-report-secs", Element::integer},
{"alarms", Element::list}
}

List of valid parameters and expected types.

Definition at line 136 of file perfmon_config.h.

Referenced by parse().

◆ enable_monitoring_

bool isc::perfmon::PerfMonConfig::enable_monitoring_
protected

If true, performance data is processed/reported.

Defaults to true. If false the library loads and configures but does nothing. Gives users a way to keep the library loaded without it being active. Should be accessible via explicit API command.

Definition at line 241 of file perfmon_config.h.

Referenced by getEnableMonitoring(), isc::perfmon::PerfMonMgr::processPktEventStack(), and setEnableMonitoring().

◆ family_

uint16_t isc::perfmon::PerfMonConfig::family_
protected

Protocol family AF_INET or AF_INET6.

Definition at line 235 of file perfmon_config.h.

Referenced by PerfMonConfig(), getFamily(), isc::perfmon::PerfMonMgr::init(), parse(), parseAlarms(), and isc::perfmon::PerfMonMgr::processPktEventStack().

◆ interval_width_secs_

uint32_t isc::perfmon::PerfMonConfig::interval_width_secs_
protected

Number of seconds a duration accumulates samples until reporting.

Defaults to 60.

Definition at line 245 of file perfmon_config.h.

Referenced by getIntervalWidthSecs(), isc::perfmon::PerfMonMgr::init(), and setIntervalWidthSecs().

◆ SIMPLE_DEFAULTS

const data::SimpleDefaults isc::perfmon::PerfMonConfig::SIMPLE_DEFAULTS
static

List of valid parameter defaults.

Definition at line 139 of file perfmon_config.h.

◆ stats_mgr_reporting_

bool isc::perfmon::PerfMonConfig::stats_mgr_reporting_
protected

If true durations report to StatsMgr at the end of each interval.

Defaults to true.

Definition at line 249 of file perfmon_config.h.

Referenced by getStatsMgrReporting(), and setStatsMgrReporting().


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