Kea 2.7.5
|
Houses the PerfMon configuration parameters for a single scope (e.g. More...
#include <perfmon_config.h>
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. | |
Houses the PerfMon configuration parameters for a single scope (e.g.
global, subnet...);
Definition at line 135 of file perfmon_config.h.
|
explicit |
Constructor.
Definition at line 267 of file perfmon_config.cc.
References alarm_store_, family_, and isc_throw.
|
virtualdefault |
Destructor.
|
inline |
Fetches the value of alarm-report-secs.
Definition at line 210 of file perfmon_config.h.
References alarm_report_secs_.
Referenced by parse().
|
inline |
Get the alarm store.
Definition at line 231 of file perfmon_config.h.
References alarm_store_.
Referenced by parse().
|
inline |
Fetches the value of enable-monitoring.
Definition at line 168 of file perfmon_config.h.
References enable_monitoring_.
Referenced by parse().
|
inline |
Get protocol family.
Definition at line 224 of file perfmon_config.h.
References family_.
Referenced by parse().
|
inline |
Fetches the 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().
|
inline |
Fetches the 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().
void isc::perfmon::PerfMonConfig::parse | ( | data::ConstElementPtr | config | ) |
Extracts member values from an Element::map.
config | map of configuration parameters. |
DhcpConfigError | if invalid values are detected. |
Definition at line 281 of file perfmon_config.cc.
References alarm_report_secs_, alarm_store_, isc::data::SimpleParser::checkKeywords(), CONFIG_KEYWORDS, enable_monitoring_, family_, getAlarmReportSecs(), getAlarmStore(), getEnableMonitoring(), getFamily(), getIntervalWidthSecs(), getStatsMgrReporting(), interval_width_secs_, isc_throw, parseAlarms(), setAlarmReportSecs(), setEnableMonitoring(), setIntervalWidthSecs(), setStatsMgrReporting(), and stats_mgr_reporting_.
Referenced by isc::perfmon::PerfMonMgr::configure().
void isc::perfmon::PerfMonConfig::parseAlarms | ( | data::ConstElementPtr | config | ) |
Re-creates the AlarmStore and populates it by parsing a list of alarm elements.
config | list of alarm configuration elements. |
DhcpConfigError | if 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().
|
inline |
Sets the value of alarm-report-secs.
value | new value for alarm-report-secs. |
Definition at line 217 of file perfmon_config.h.
References alarm_report_secs_.
Referenced by parse().
|
inline |
Sets the value of enable-monitoring.
value | new value for enable-monitoring. |
Definition at line 175 of file perfmon_config.h.
References enable_monitoring_.
Referenced by isc::perfmon::PerfMonMgr::configure(), and parse().
|
inline |
Sets the value of interval-width-secs.
value | new value for interval-width-secs. |
Definition at line 189 of file perfmon_config.h.
References interval_width_secs_.
Referenced by parse().
|
inline |
Sets the value of stats-mgr-reporting.
value | new value for stats-mgr-reporting. |
Definition at line 203 of file perfmon_config.h.
References stats_mgr_reporting_.
Referenced by parse().
|
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().
|
protected |
Stores the configured alarms.
Definition at line 258 of file perfmon_config.h.
Referenced by PerfMonConfig(), isc::perfmon::PerfMonMgr::addDurationSample(), getAlarmStore(), parse(), parseAlarms(), and isc::perfmon::PerfMonMgr::reportAlarm().
|
static |
List of valid parameters and expected types.
Definition at line 138 of file perfmon_config.h.
Referenced by parse().
|
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().
|
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().
|
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().
|
static |
List of valid parameter defaults.
Definition at line 141 of file perfmon_config.h.
|
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().