Kea 2.7.0
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.
 
std::atomic< 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.
 
std::atomic< 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 135 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 210 of file perfmon_config.h.

References alarm_report_secs_.

Referenced by parse().

◆ getAlarmStore()

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

Get the alarm store.

Returns
pointer to the alarm store.

Definition at line 231 of file perfmon_config.h.

References alarm_store_.

Referenced by parse().

◆ getEnableMonitoring()

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

Fetches the value of enable-monitoring.

Returns
boolean value of enable-monitoring.

Definition at line 168 of file perfmon_config.h.

References enable_monitoring_.

Referenced by parse().

◆ 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 224 of file perfmon_config.h.

References family_.

Referenced by parse().

◆ 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 182 of file perfmon_config.h.

References interval_width_secs_.

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

◆ 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 196 of file perfmon_config.h.

References stats_mgr_reporting_.

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

◆ parse()

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

◆ 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 337 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 217 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 175 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 189 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 203 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 255 of file perfmon_config.h.

Referenced by getAlarmReportSecs(), isc::perfmon::PerfMonMgr::init(), parse(), 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 138 of file perfmon_config.h.

Referenced by parse().

◆ enable_monitoring_

std::atomic<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 243 of file perfmon_config.h.

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

◆ family_

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

Protocol family AF_INET or AF_INET6.

Definition at line 237 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 247 of file perfmon_config.h.

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

◆ SIMPLE_DEFAULTS

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

List of valid parameter defaults.

Definition at line 141 of file perfmon_config.h.

◆ stats_mgr_reporting_

std::atomic<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 251 of file perfmon_config.h.

Referenced by getStatsMgrReporting(), parse(), isc::perfmon::PerfMonMgr::perfmonControlHandler(), and setStatsMgrReporting().


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