uint8_t query_type,
uint8_t response_type,
const std::string& start_event_label,
- const std::string& end_event_label,
+ const std::string& stop_event_label,
dhcp::SubnetID subnet_id,
const Duration& low_water,
const Duration& high_water,
bool enabled /* = true */)
- : DurationKey(family, query_type, response_type, start_event_label, end_event_label, subnet_id),
+ : DurationKey(family, query_type, response_type, start_event_label, stop_event_label, subnet_id),
low_water_(low_water),
high_water_(high_water),
state_(enabled ? CLEAR : DISABLED),
/// @param query_type message type of the query packet
/// @param response_type message type of the response packet
/// @param start_event_label label of the start event
- /// @param end_event_label label of the end event
+ /// @param stop_event_label label of the end event
/// @param subnet_id SubnetID of the selected subnet
/// @param low_water threshold below which the average duration must fall to clear the alarm
/// @param high_water threshold above which the average duration must rise to trigger the alarm.
/// @param enabled true sets state to CLEAR, otherwise DISABLED, defaults to true.
Alarm(uint16_t family, uint8_t query_type, uint8_t response_type,
- const std::string& start_event_label, const std::string& end_event_label,
+ const std::string& start_event_label, const std::string& stop_event_label,
dhcp::SubnetID subnet_id,
const Duration& low_water, const Duration& high_water, bool enabled = true);
uint8_t query_type,
uint8_t response_type,
const std::string& start_event_label,
- const std::string& end_event_label,
+ const std::string& stop_event_label,
dhcp::SubnetID subnet_id)
: family_(family),
query_type_(query_type),
response_type_(response_type),
start_event_label_(start_event_label),
- end_event_label_(end_event_label),
+ stop_event_label_(stop_event_label),
subnet_id_(subnet_id) {
if (family != AF_INET && family != AF_INET6) {
isc_throw (BadValue, "DurationKey: family must be AF_INET or AF_INET6");
<< (response_type_ == DHCPV6_NOTYPE ? "NONE" : Pkt6::getName(response_type_));
}
- oss << "." << start_event_label_ << "-" << end_event_label_
+ oss << "." << start_event_label_ << "-" << stop_event_label_
<< "." << subnet_id_;
return (oss.str());
(query_type_ == other.query_type_) &&
(response_type_ == other.response_type_) &&
(start_event_label_ == other.start_event_label_) &&
- (end_event_label_ == other.end_event_label_) &&
+ (stop_event_label_ == other.stop_event_label_) &&
(subnet_id_ == other.subnet_id_)
);
}
(query_type_ < other.query_type_) ||
(response_type_ < other.response_type_) ||
(start_event_label_ < other.start_event_label_) ||
- (end_event_label_ < other.end_event_label_) ||
+ (stop_event_label_ < other.stop_event_label_) ||
(subnet_id_ < other.subnet_id_)
);
}
uint8_t query_type,
uint8_t response_type,
const std::string& start_event_label,
- const std::string& end_event_label,
+ const std::string& stop_event_label,
dhcp::SubnetID subnet_id,
const Duration& interval_duration)
- : DurationKey(family, query_type, response_type, start_event_label, end_event_label, subnet_id),
+ : DurationKey(family, query_type, response_type, start_event_label, stop_event_label, subnet_id),
interval_duration_(interval_duration),
current_interval_(0),
previous_interval_(0) {
/// -# Query Packet Type
/// -# Response Packet Type
/// -# Start Event
-/// -# End Event
+/// -# Stop Event
/// -# Subnet ID can be GLOBAL_SUBNET_ID for aggregate durations
class DurationKey {
public:
/// @param query_type message type of the query packet
/// @param response_type message type of the response packet
/// @param start_event_label label of the start event
- /// @param end_event_label label of the end event
+ /// @param stop_event_label label of the end event
/// @param subnet_id id of the selected subnet
DurationKey(uint16_t family, uint8_t query_type, uint8_t response_type,
- const std::string& start_event_label, const std::string& end_event_label,
+ const std::string& start_event_label, const std::string& stop_event_label,
dhcp::SubnetID subnet_id);
/// @brief Destructor
/// @brief Get the end event label.
///
/// @return the end event label.
- std::string getEndEventLabel() const {
- return (end_event_label_);
+ std::string getStopEventLabel() const {
+ return (stop_event_label_);
}
/// @brief Get the subnet id.
/// The format of the string:
///
/// @code
- /// <query type>-<response type>.<start_event>-<end_event>.<subnet id>
+ /// <query type>-<response type>.<start_event>-<stop_event>.<subnet id>
///
/// Example:
///
std::string start_event_label_;
/// @brief Label of the end event which ends the duration.
- std::string end_event_label_;
+ std::string stop_event_label_;
/// @brief Subnet ID of the subnet selected during query fulfillment.
isc::dhcp::SubnetID subnet_id_;
/// @param query_type message type of the query packet
/// @param response_type message type of the response packet
/// @param start_event_label label of the start event
- /// @param end_event_label label of the end event
+ /// @param stop_event_label label of the end event
/// @param subnet_id id of the selected subnet
/// @param interval_duration the interval duration
MonitoredDuration(uint16_t family, uint8_t query_type, uint8_t response_type,
- const std::string& start_event_label, const std::string& end_event_label,
+ const std::string& start_event_label, const std::string& stop_event_label,
dhcp::SubnetID subnet_id, const Duration& interval_duration);
/// @brief Constructor
EXPECT_EQ(alarm->getQueryType(), DHCPDISCOVER);
EXPECT_EQ(alarm->getResponseType(), DHCPOFFER);
EXPECT_EQ(alarm->getStartEventLabel(), "process_started");
- EXPECT_EQ(alarm->getEndEventLabel(), "process_completed");
+ EXPECT_EQ(alarm->getStopEventLabel(), "process_completed");
EXPECT_EQ(alarm->getSubnetId(), SUBNET_ID_GLOBAL);
EXPECT_EQ("DHCPDISCOVER-DHCPOFFER.process_started-process_completed.0", alarm->getLabel());
EXPECT_EQ(alarm->getSubnetId(), SUBNET_ID_GLOBAL);
EXPECT_EQ(alarm->getQueryType(), DHCPV6_SOLICIT);
EXPECT_EQ(alarm->getResponseType(), DHCPV6_ADVERTISE);
EXPECT_EQ(alarm->getStartEventLabel(), "mt_queued");
- EXPECT_EQ(alarm->getEndEventLabel(), "process_started");
+ EXPECT_EQ(alarm->getStopEventLabel(), "process_started");
EXPECT_EQ(alarm->getSubnetId(), 77);
EXPECT_EQ("SOLICIT-ADVERTISE.mt_queued-process_started.77", alarm->getLabel());
EXPECT_EQ(alarm->getLowWater(), low_water);
EXPECT_EQ(key->getQueryType(), DHCPDISCOVER);
EXPECT_EQ(key->getResponseType(), DHCPOFFER);
EXPECT_EQ(key->getStartEventLabel(), "process_started");
- EXPECT_EQ(key->getEndEventLabel(), "process_completed");
+ EXPECT_EQ(key->getStopEventLabel(), "process_completed");
EXPECT_EQ(key->getSubnetId(), SUBNET_ID_GLOBAL);
EXPECT_EQ("DHCPDISCOVER-DHCPOFFER.process_started-process_completed.0", key->getLabel());
EXPECT_EQ(key->getQueryType(), DHCPV6_SOLICIT);
EXPECT_EQ(key->getResponseType(), DHCPV6_ADVERTISE);
EXPECT_EQ(key->getStartEventLabel(), "mt_queued");
- EXPECT_EQ(key->getEndEventLabel(), "process_started");
+ EXPECT_EQ(key->getStopEventLabel(), "process_started");
EXPECT_EQ(key->getSubnetId(), 77);
EXPECT_EQ("SOLICIT-ADVERTISE.mt_queued-process_started.77", key->getLabel());
EXPECT_EQ(mond->getQueryType(), DHCPDISCOVER);
EXPECT_EQ(mond->getResponseType(), DHCPOFFER);
EXPECT_EQ(mond->getStartEventLabel(), "process_started");
- EXPECT_EQ(mond->getEndEventLabel(), "process_completed");
+ EXPECT_EQ(mond->getStopEventLabel(), "process_completed");
EXPECT_EQ(mond->getSubnetId(), SUBNET_ID_GLOBAL);
EXPECT_EQ("DHCPDISCOVER-DHCPOFFER.process_started-process_completed.0", mond->getLabel());
EXPECT_EQ(mond->getIntervalDuration(), interval_duration);
EXPECT_EQ(mond->getQueryType(), DHCPV6_SOLICIT);
EXPECT_EQ(mond->getResponseType(), DHCPV6_ADVERTISE);
EXPECT_EQ(mond->getStartEventLabel(), "mt_queued");
- EXPECT_EQ(mond->getEndEventLabel(), "process_started");
+ EXPECT_EQ(mond->getStopEventLabel(), "process_started");
EXPECT_EQ(mond->getSubnetId(), 77);
EXPECT_EQ("SOLICIT-ADVERTISE.mt_queued-process_started.77", mond->getLabel());
EXPECT_EQ(mond->getIntervalDuration(), interval_duration);