]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#3253] Renamed end_event to stop_event
authorThomas Markwalder <tmark@isc.org>
Tue, 12 Mar 2024 17:31:30 +0000 (13:31 -0400)
committerThomas Markwalder <tmark@isc.org>
Mon, 18 Mar 2024 19:12:14 +0000 (19:12 +0000)
src/hooks/dhcp/perfmon/alarm.*
src/hooks/dhcp/perfmon/monitored_duration.*
src/hooks/dhcp/perfmon/tests/alarm_unittests.cc
src/hooks/dhcp/perfmon/tests/monitored_duration_unittests.cc
    - renamed DurationKey::end_event_ to DurationKey::stop_event_

src/hooks/dhcp/perfmon/alarm.cc
src/hooks/dhcp/perfmon/alarm.h
src/hooks/dhcp/perfmon/monitored_duration.cc
src/hooks/dhcp/perfmon/monitored_duration.h
src/hooks/dhcp/perfmon/tests/alarm_unittests.cc
src/hooks/dhcp/perfmon/tests/monitored_duration_unittests.cc

index d32ce8b8094fd61f87771a7be3ff9704476284fa..1ba8fc25bc3f8328786d679c31b2980b062d2264 100644 (file)
@@ -22,12 +22,12 @@ Alarm::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& 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),
index 0e1427742daa35bc13c582221d3674d3fb13d0f2..00005572ea91a94533eacb0e7138b04990d5c4b9 100644 (file)
@@ -32,13 +32,13 @@ 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 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);
 
index 4f436bff887b658b34d8a618343297f020e068cb..d81b7c638b33ae2a70ca5239c592680a89c07422 100644 (file)
@@ -63,13 +63,13 @@ DurationKey::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& 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");
@@ -166,7 +166,7 @@ DurationKey::getLabel() const {
             << (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());
@@ -178,7 +178,7 @@ DurationKey::operator==(const DurationKey& other) const {
         (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_)
     );
 }
@@ -194,7 +194,7 @@ DurationKey::operator<(const DurationKey& other) const {
         (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_)
     );
 }
@@ -206,10 +206,10 @@ MonitoredDuration::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& 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) {
index 314482b468b748bacb89deae2694972bdfce9aa6..2893d82650b560be4a2c79225c5698fe463ca8f2 100644 (file)
@@ -127,7 +127,7 @@ typedef boost::shared_ptr<DurationDataInterval> DurationDataIntervalPtr;
 /// -# 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:
@@ -137,10 +137,10 @@ 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
@@ -177,8 +177,8 @@ public:
     /// @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.
@@ -194,7 +194,7 @@ public:
     /// 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:
     ///
@@ -254,7 +254,7 @@ protected:
     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_;
@@ -271,11 +271,11 @@ 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
     /// @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
index ffae6d12612461923f5c512a8dd6bb9b83db43e9..0814dc457457fa27b777a72bae60086ed92d88e8 100644 (file)
@@ -38,7 +38,7 @@ TEST(Alarm, validConstructors) {
     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);
@@ -60,7 +60,7 @@ TEST(Alarm, validConstructors) {
     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);
index cae425df63054d0b1f6b68c1b6419dafaa576a33..09aa77683b5588cbc81838200d0c3716aa471deb 100644 (file)
@@ -93,7 +93,7 @@ TEST(DurationKey, basics) {
     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());
 
@@ -105,7 +105,7 @@ TEST(DurationKey, basics) {
     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());
 
@@ -263,7 +263,7 @@ TEST(MonitoredDuration, validConstructors) {
     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);
@@ -281,7 +281,7 @@ TEST(MonitoredDuration, validConstructors) {
     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);