]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#3297] addressed review
authorRazvan Becheriu <razvan@isc.org>
Wed, 3 Apr 2024 13:57:18 +0000 (16:57 +0300)
committerRazvan Becheriu <razvan@isc.org>
Wed, 3 Apr 2024 13:57:18 +0000 (16:57 +0300)
src/hooks/dhcp/perfmon/libloadtests/load_unload_unittests.cc
src/hooks/dhcp/perfmon/monitored_duration.cc
src/hooks/dhcp/perfmon/monitored_duration.h
src/hooks/dhcp/perfmon/monitored_duration_store.cc
src/hooks/dhcp/perfmon/perfmon_callouts.cc
src/hooks/dhcp/perfmon/perfmon_messages.mes
src/hooks/dhcp/perfmon/perfmon_mgr.cc
src/hooks/dhcp/perfmon/perfmon_mgr.h
src/hooks/dhcp/perfmon/tests/monitored_duration_store_unittests.cc
src/hooks/dhcp/perfmon/tests/perfmon_mgr_unittests.cc

index 9a3f30c5ad125ab8695a8fc13738046b634c2deb..3a187cfe4e012289a4b2bd5ebee49bbed21db71e 100644 (file)
@@ -44,14 +44,15 @@ public:
     }
 
     /// @brief Registers hooks in the hook manager.
+    ///
     /// Normally this is done by the server core code.
     void registerHooks() {
         if (isc::dhcp::CfgMgr::instance().getFamily() == AF_INET) {
             hook_index_dhcpx_srv_configured_ = HooksManager::registerHook("dhcp4_srv_configured");
-            hook_index_pktx_send_ =  HooksManager::registerHook("pkt4_send");
+            hook_index_pktx_send_ = HooksManager::registerHook("pkt4_send");
         } else {
             hook_index_dhcpx_srv_configured_ = HooksManager::registerHook("dhcp6_srv_configured");
-            hook_index_pktx_send_ =  HooksManager::registerHook("pkt6_send");
+            hook_index_pktx_send_ = HooksManager::registerHook("pkt6_send");
         }
     }
 
index 9487e9bd7ceef85e6d3f498474630f4eeaa4fae7..af51f2eb185875baf77ccf297cd9843c06f44745 100644 (file)
@@ -175,13 +175,13 @@ DurationKey::getLabel() const {
         << "." << subnet_id_;
 
     return (oss.str());
-};
+}
 
 std::string
 DurationKey::getStatName(const std::string& value_name) const {
     std::ostringstream oss;
     if (subnet_id_ != SUBNET_ID_GLOBAL) {
-        oss << "subnet-id["  << subnet_id_ << "].";
+        oss << "subnet-id[" << subnet_id_ << "].";
     }
 
     oss << "perfmon."
@@ -192,7 +192,7 @@ DurationKey::getStatName(const std::string& value_name) const {
         << "." << value_name;
 
     return (oss.str());
-};
+}
 
 bool
 DurationKey::operator==(const DurationKey& other) const {
index 2f025e5faf0a80220bbb4050f4bf93cc7bc6ba64..893544493e575c9c0e8260d5f600910d39f81362 100644 (file)
@@ -190,7 +190,7 @@ public:
 
     /// @brief Set the subnet id.
     ///
-    /// @param subnet_id new value for subnet id.x
+    /// @param subnet_id new value for subnet id.
     void setSubnetId(dhcp::SubnetID subnet_id) {
         subnet_id_ = subnet_id;
     }
@@ -224,16 +224,16 @@ public:
     /// @return the composite label.
     std::string getLabel() const;
 
-    /// @brief Get the StatsMgr formatted compatible name
+    /// @brief Get the StatsMgr formatted compatible name.
     ///
-    /// @param value_name  name of the specific value (e.g. "average-ms", "min-duration-ms")
+    /// @param value_name name of the specific value (e.g. "average-ms", "min-duration-ms").
     /// The format of the string:
     ///
     /// @code
     ///
     ///     {subnet-id[x]}.perfmon.<query type>-<response type>.<start event>-<end event>.<value-name>
     ///
-    /// Example:
+    /// Examples:
     ///
     ///  perfmon.discover-offer.socket_received-buffer_read.average-ms
     ///
index d0f0b317384ec152f87a19b148a7c92ae89a2357..d4d50757f41c42346b9c022b32661e289aec84f2 100644 (file)
@@ -116,7 +116,7 @@ MonitoredDurationStore::addDuration(DurationKeyPtr key) {
         if (ret.second == false) {
             isc_throw(DuplicateDurationKey,
                       "MonitoredDurationStore::addDuration: duration already exists for: "
-                      << key->getLabel());
+                      << mond->getLabel());
         }
     }
 
index fa029d0528676172881367b326ed5649ed173227..b90fc96fee8ae4581829c54438465c3e5df814d5 100644 (file)
@@ -38,18 +38,16 @@ extern "C" {
 int dhcp4_srv_configured(CalloutHandle& /* handle */) {
     // We do this here rather than in load() to ensure we check after the
     // packet filter has been determined.
-    LOG_DEBUG(perfmon_logger, DBGLVL_TRACE_BASIC,
-              PERFMON_DHCP4_SOCKET_RECEIVED_TIME_SUPPORT)
-              .arg(IfaceMgr::instance().isSocketReceivedTimeSupported() ? "Yes" : "No");
+    LOG_DEBUG(perfmon_logger, DBGLVL_TRACE_BASIC, PERFMON_DHCP4_SOCKET_RECEIVED_TIME_SUPPORT)
+            .arg(IfaceMgr::instance().isSocketReceivedTimeSupported() ? "Yes" : "No");
     return (0);
 }
 
 int dhcp6_srv_configured(CalloutHandle& /* handle */) {
     // We do this here rather than in load() to ensure we check after the
     // packet filter has been determined.
-    LOG_DEBUG(perfmon_logger, DBGLVL_TRACE_BASIC,
-              PERFMON_DHCP6_SOCKET_RECEIVED_TIME_SUPPORT)
-              .arg(IfaceMgr::instance().isSocketReceivedTimeSupported() ? "Yes" : "No");
+    LOG_DEBUG(perfmon_logger, DBGLVL_TRACE_BASIC, PERFMON_DHCP6_SOCKET_RECEIVED_TIME_SUPPORT)
+            .arg(IfaceMgr::instance().isSocketReceivedTimeSupported() ? "Yes" : "No");
     return (0);
 }
 
@@ -78,8 +76,8 @@ int pkt4_send(CalloutHandle& handle) {
         mgr->processPktEventStack(query, response, subnet->getID());
     } catch (const std::exception& ex) {
         LOG_DEBUG(perfmon_logger, DBGLVL_TRACE_DETAIL, PERFMON_DHCP4_PKT_PROCESS_ERROR)
-                  .arg(query->getLabel())
-                  .arg(ex.what());
+                .arg(query->getLabel())
+                .arg(ex.what());
     }
 
     return (0);
@@ -110,8 +108,8 @@ int pkt6_send(CalloutHandle& handle) {
         mgr->processPktEventStack(query, response, subnet->getID());
     } catch (const std::exception& ex) {
         LOG_DEBUG(perfmon_logger, DBGLVL_TRACE_DETAIL, PERFMON_DHCP6_PKT_PROCESS_ERROR)
-                  .arg(query->getLabel())
-                  .arg(ex.what());
+                .arg(query->getLabel())
+                .arg(ex.what());
     }
 
     return (0);
@@ -146,7 +144,8 @@ int load(LibraryHandle& handle) {
         /// @todo register commands
         /// handle.registerCommandCallout("command-here", handler_here);
     } catch (const std::exception& ex) {
-        LOG_ERROR(perfmon_logger, PERFMON_INIT_FAILED).arg(ex.what());
+        LOG_ERROR(perfmon_logger, PERFMON_INIT_FAILED)
+               .arg(ex.what());
         return (1);
     }
 
index 85d893611b68ca354082c00cb699f8acc916b381..907105036c59694660fbb1d838dc3cb5a79f626e 100644 (file)
@@ -42,7 +42,7 @@ the log message.
 This info message indicates that the PerfMon hooks library has been
 loaded successfully. Enjoy!
 
-% PERFMON_ALARM_CLEARED Alarm for %1 has been cleared, reported average duration %2 is now beloe low-water-ms: %3
+% PERFMON_ALARM_CLEARED Alarm for %1 has been cleared, reported average duration %2 is now below low-water-ms: %3
 This info message is emitted when the reported average duration for
 an alarm that has been triggered has fallen below the value of its
 low-water-ms parameter. The arguments detail the alarm's key and
@@ -54,18 +54,18 @@ an alarm exceeds its high-water-ms value.  As long as the reported
 averges remain above the low-water-ms value, the alarm will remain
 triggered and this message will be repeated every alarm-report-secs.
 Arguments detail the alarm's key, the time the alarm was first
-triggered, the most recent reported average, and the high-watr-ms
+triggered, the most recent reported average, and the high-water-ms
 value.
 
 % PERFMON_DHCP4_PKT_PROCESS_ERROR Packet event stack was not processed for query %1, reason %2
-This debug message is emitted when the query's event stack could not
+This debug message is emitted when the query's event stack could not
 be processed. This is most likely a programmatic error and should be
 reported.  The arguments identify the query and the reason it could
 not be processed.  These errors should not affect server's normal
 operations.
 
 % PERFMON_DHCP6_PKT_PROCESS_ERROR Packet event stack was not processed for query %1, reason %2
-This debug message is emitted when the query's event stack could not
+This debug message is emitted when the query's event stack could not
 be processed. This is most likely a programmatic error and should be
 reported.  The arguments identify the query and the reason it could
 not be processed.  These errors should not affect server's normal
index 6d0739a33c29e3e14cb01894305e3b4ee9ed79b5..2a526062e8aa2451d7d83d83d7c35750b8613004 100644 (file)
@@ -94,8 +94,8 @@ PerfMonMgr::processPktEventStack(isc::dhcp::PktPtr query,
 
     LOG_DEBUG(perfmon_logger, DBGLVL_TRACE_DETAIL,
               (family_ == AF_INET ? PERFMON_DHCP4_PKT_EVENTS : PERFMON_DHCP6_PKT_EVENTS))
-              .arg(query->getLabel())
-              .arg(query->dumpPktEvents());
+            .arg(query->getLabel())
+            .arg(query->dumpPktEvents());
 
     // If monitoring is disabled, then punt.
     if (!enable_monitoring_) {
@@ -115,7 +115,7 @@ PerfMonMgr::processPktEventStack(isc::dhcp::PktPtr query,
         } else {
             Duration sample = event.timestamp_ - prev_time;
             DurationKeyPtr key(new DurationKey(family_, query_type, response_type,
-                               prev_event_label, event.label_, subnet_id));
+                                               prev_event_label, event.label_, subnet_id));
             addDurationSample(key, sample);
 
             // Update global duration.
@@ -132,7 +132,7 @@ PerfMonMgr::processPktEventStack(isc::dhcp::PktPtr query,
     // Generate composite total.
     Duration sample = prev_time - start_time;
     DurationKeyPtr key(new DurationKey(family_, query_type, response_type,
-                       "composite", "total_response", subnet_id));
+                                       "composite", "total_response", subnet_id));
     addDurationSample(key, sample);
     // Update global duration.
     if (subnet_id != SUBNET_ID_GLOBAL) {
@@ -162,12 +162,12 @@ PerfMonMgr::addDurationSample(DurationKeyPtr key, const Duration& sample) {
 Duration
 PerfMonMgr::reportToStatsMgr(MonitoredDurationPtr duration) {
     if (!duration) {
-        isc_throw(BadValue, "reportToStatsMgr - duration is empty");
+        isc_throw(BadValue, "reportToStatsMgr - duration is empty!");
     }
 
     auto previous_interval = duration->getPreviousInterval();
     if (!previous_interval) {
-        isc_throw(BadValue, "reportToStatsMgr - duration previous interval is empty");
+        isc_throw(BadValue, "reportToStatsMgr - duration previous interval is empty!");
     }
 
     auto average = previous_interval->getAverageDuration();
@@ -178,7 +178,7 @@ PerfMonMgr::reportToStatsMgr(MonitoredDurationPtr duration) {
 
     /// @todo - decide if we want to report min and max values too.
 
-    return(average);
+    return (average);
 }
 
 void
index 4ba3bbed78c580fa3fdbc10b285beab24b9d77c8..2c153b2c92f386511809810d0d058c9dc124f3f5 100644 (file)
@@ -39,6 +39,7 @@ public:
     void configure(const isc::data::ConstElementPtr& params);
 
     /// @brief Sets convenience values and (re)creates the duration store.
+    ///
     /// Called by the constructor and also by configure().
     virtual void init();
 
index 1f058641036b5f25ea201a5dec212b774bf58292..0dd4088827e50ae32a07107d49495b24fec01efb 100644 (file)
@@ -56,7 +56,7 @@ TEST(MonitoredDurationStore, invalidConstructors) {
                      " -00:00:00.005000, must be greater than zero");
 }
 
-/// @brief Text fixture class for @c MonitoredDurationStore
+/// @brief Text fixture class for @c MonitoredDurationStore.
 ///
 /// In order to facilitate single and multi threaded testing,
 /// individual tests are implemented as methods that are called
@@ -64,18 +64,18 @@ TEST(MonitoredDurationStore, invalidConstructors) {
 class MonitoredDurationStoreTest : public ::testing::Test {
 public:
 
-    /// @brief Constructor
+    /// @brief Constructor.
     MonitoredDurationStoreTest() = default;
 
-    /// @brief Destructor
+    /// @brief Destructor.
     virtual ~MonitoredDurationStoreTest() = default;
 
-    /// @brief Creates a protocol-specific DurationKey for a given subnet
+    /// @brief Creates a protocol-specific DurationKey for a given subnet.
     ///
     /// The message-pair and socket-event pairs are fixed.
     ///
-    /// @param family protocol family to test, AF_INET or AF_INET6
-    /// @param subnet SubnetID of the duration
+    /// @param family protocol family to test, AF_INET or AF_INET6.
+    /// @param subnet SubnetID of the duration.
     DurationKeyPtr makeKey(uint16_t family, SubnetID subnet = 1) {
         DurationKeyPtr key;
         if (family == AF_INET) {
@@ -90,7 +90,7 @@ public:
     /// @brief Verifies that durations can be added to the store and fetched
     /// by DurationKey.
     ///
-    /// @param family protocol family to test, AF_INET or AF_INET6
+    /// @param family protocol family to test, AF_INET or AF_INET6.
     void addDurationTest(uint16_t family) {
         Duration interval_duration(milliseconds(10));
         MonitoredDurationStore store(family, interval_duration);
@@ -130,7 +130,7 @@ public:
 
     /// @brief Verifies that duplicate durations cannot be added to the store.
     ///
-    /// @param family protocol family to test, AF_INET or AF_INET6
+    /// @param family protocol family to test, AF_INET or AF_INET6.
     void addDurationDuplicateTest(uint16_t family) {
         Duration interval_duration(milliseconds(10));
         MonitoredDurationStore store(family, interval_duration);
@@ -175,7 +175,7 @@ public:
 
     /// @brief Verify that durations can be deleted from the store.
     ///
-    /// @param family protocol family to test, AF_INET or AF_INET6
+    /// @param family protocol family to test, AF_INET or AF_INET6.
     void deleteDurationTest(uint16_t family) {
         MonitoredDurationStore store(family, milliseconds(5));
 
@@ -246,7 +246,7 @@ public:
 
     /// @brief Verify that durations in the store can be updated.
     ///
-    /// @param family protocol family to test, AF_INET or AF_INET6
+    /// @param family protocol family to test, AF_INET or AF_INET6.
     void updateDurationTest(uint16_t family) {
         Duration interval_duration(seconds(60));
         MonitoredDurationStore store(family, interval_duration);
@@ -330,7 +330,7 @@ public:
 
     /// @brief Exercises addDurationSample() valid behavior.
     ///
-    /// @param family protocol family to test, AF_INET or AF_INET6
+    /// @param family protocol family to test, AF_INET or AF_INET6.
     void addDurationSampleTest(uint16_t family) {
         // Create a store.
         Duration interval_duration(milliseconds(50));
@@ -393,9 +393,9 @@ public:
         EXPECT_EQ(previous_interval->getTotalDuration(), (five_ms) * 2);
     }
 
-    /// @brief Veriries getReportsNext and getOverdueReports
+    /// @brief Veriries getReportsNext and getOverdueReports.
     ///
-    /// @param family protocol family to test, AF_INET or AF_INET6
+    /// @param family protocol family to test, AF_INET or AF_INET6.
     void reportDueTest(uint16_t family) {
         // Create a store.
         Duration interval_duration(milliseconds(100));
@@ -486,7 +486,7 @@ public:
     /// of adding duration samples. It does not pass or fail and thus is not
     /// included in explicit UTs.
     ///
-    /// @param family protocol family to test, AF_INET or AF_INET6
+    /// @param family protocol family to test, AF_INET or AF_INET6.
     void speedCheck(uint16_t family) {
         // Create a store.
         Duration interval_duration(microseconds(100));
@@ -534,7 +534,7 @@ public:
 
     /// @brief Verifies that composite key index compares correctly with adjacent events.
     ///
-    /// @param family protocol family to test, AF_INET or AF_INET6
+    /// @param family protocol family to test, AF_INET or AF_INET6.
     void adjacentEventTest(uint16_t family) {
         Duration interval_duration(milliseconds(10));
         MonitoredDurationStore store(family, interval_duration);
@@ -568,11 +568,11 @@ public:
 
 };
 
-TEST_F(MonitoredDurationStoreTest, addDuration) {
+TEST_F(MonitoredDurationStoreTest, addDuration4) {
     addDurationTest(AF_INET);
 }
 
-TEST_F(MonitoredDurationStoreTest, addDurationMultiThreading) {
+TEST_F(MonitoredDurationStoreTest, addDuration4MultiThreading) {
     MultiThreadingTest mt;
     addDurationTest(AF_INET);
 }
@@ -586,11 +586,11 @@ TEST_F(MonitoredDurationStoreTest, addDuration6MultiThreading) {
     addDurationTest(AF_INET6);
 }
 
-TEST_F(MonitoredDurationStoreTest, addDurationDuplicate) {
+TEST_F(MonitoredDurationStoreTest, addDuration4Duplicate) {
     addDurationDuplicateTest(AF_INET);
 }
 
-TEST_F(MonitoredDurationStoreTest, addDurationDuplicateMultiThreading) {
+TEST_F(MonitoredDurationStoreTest, addDuration4DuplicateMultiThreading) {
     MultiThreadingTest mt;
     addDurationDuplicateTest(AF_INET);
 }
@@ -613,11 +613,11 @@ TEST_F(MonitoredDurationStoreTest, addDurationInvalidMultiThreading) {
     addDurationInvalidTest();
 }
 
-TEST_F(MonitoredDurationStoreTest, deleteDuration) {
+TEST_F(MonitoredDurationStoreTest, deleteDuration4) {
     deleteDurationTest(AF_INET);
 }
 
-TEST_F(MonitoredDurationStoreTest, deleteDurationMultiThreading) {
+TEST_F(MonitoredDurationStoreTest, deleteDuration4MultiThreading) {
     MultiThreadingTest mt;
     deleteDurationTest(AF_INET);
 }
@@ -640,11 +640,11 @@ TEST_F(MonitoredDurationStoreTest, deleteDurationInvalidMultiThreading) {
     deleteDurationInvalidTest();
 }
 
-TEST_F(MonitoredDurationStoreTest, updateDuration) {
+TEST_F(MonitoredDurationStoreTest, updateDuration4) {
     updateDurationTest(AF_INET);
 }
 
-TEST_F(MonitoredDurationStoreTest, updateDurationMultiThreading) {
+TEST_F(MonitoredDurationStoreTest, updateDuration4MultiThreading) {
     MultiThreadingTest mt;
     updateDurationTest(AF_INET);
 }
@@ -667,11 +667,11 @@ TEST_F(MonitoredDurationStoreTest, updateDurationInvalidMultiThreading) {
     updateDurationInvalidTest();
 }
 
-TEST_F(MonitoredDurationStoreTest, addDurationSample) {
+TEST_F(MonitoredDurationStoreTest, addDurationSample4) {
     addDurationSampleTest(AF_INET);
 }
 
-TEST_F(MonitoredDurationStoreTest, addDurationSampleMultiThreading) {
+TEST_F(MonitoredDurationStoreTest, addDurationSample4MultiThreading) {
     MultiThreadingTest mt;
     addDurationSampleTest(AF_INET);
 }
@@ -685,11 +685,11 @@ TEST_F(MonitoredDurationStoreTest, addDurationSample6MultiThreading) {
     addDurationSampleTest(AF_INET6);
 }
 
-TEST_F(MonitoredDurationStoreTest, reportDue) {
+TEST_F(MonitoredDurationStoreTest, reportDue4) {
     reportDueTest(AF_INET);
 }
 
-TEST_F(MonitoredDurationStoreTest, reportDueMultiThreading) {
+TEST_F(MonitoredDurationStoreTest, reportDue4MultiThreading) {
     MultiThreadingTest mt;
     reportDueTest(AF_INET);
 }
@@ -703,7 +703,7 @@ TEST_F(MonitoredDurationStoreTest, reportDue6MultiThreading) {
     reportDueTest(AF_INET6);
 }
 
-TEST_F(MonitoredDurationStoreTest, adjacentEvent) {
+TEST_F(MonitoredDurationStoreTest, adjacentEvent4) {
     adjacentEventTest(AF_INET);
 }
 
index 2ce563dfb9489d9e0a1d60cde2785b6310b3799d..fd5cf8a374090c757ed777296a0e153bffa44946 100644 (file)
@@ -129,7 +129,6 @@ public:
                 // No use case for this (yet).
                 break;
             }
-
         } else {
             // State should have changed.
             ASSERT_LT(before->getStosTime(), after->getStosTime());
@@ -149,7 +148,6 @@ public:
                 // No use case for this (yet).
                 break;
             }
-
         }
 
         before = after;
@@ -157,11 +155,11 @@ public:
 
     /// @brief Check the content of a stored MonitoredDuration.
     ///
-    /// @param line_no source line of the invocation
-    /// @param key DurationKey of the target duration
-    /// @param exp_current_total_ms expected value of the current interval's total_duration_
-    /// @param exp_previous true if the duration should have previous interval, defaults to false
-    /// @param exp_previous_total_ms expected value of the previous interval's total_duration_
+    /// @param line_no source line of the invocation.
+    /// @param key DurationKey of the target duration.
+    /// @param exp_current_total_ms expected value of the current interval's total_duration_.
+    /// @param exp_previous true if the duration should have previous interval, defaults to false.
+    /// @param exp_previous_total_ms expected value of the previous interval's total_duration_.
     void checkDuration(int line_no, DurationKeyPtr key, uint64_t exp_current_total_ms,
                        bool exp_previous = false, uint64_t exp_previous_total_ms = 0) {
         std::ostringstream oss;
@@ -293,7 +291,7 @@ public:
         ASSERT_EQ(durations->size(), 0);
     }
 
-    /// @brief Exercises  PerfMonMgr::reportToStatsMgr().
+    /// @brief Exercises PerfMonMgr::reportToStatsMgr().
     void testReportToStatsMgr() {
         // Minimal valid configuration.
         std::string valid_config =
@@ -307,15 +305,15 @@ public:
 
         MonitoredDurationPtr mond;
         ASSERT_THROW_MSG(mgr_->reportToStatsMgr(mond), BadValue,
-                        "reportToStatsMgr - duration is empty");
+                         "reportToStatsMgr - duration is empty!");
 
         ASSERT_NO_THROW_LOG(
             mond.reset(new MonitoredDuration(family_, 0, 0,
                                              "process-started", "process-completed",
-                                             70,  seconds(60))));
+                                             70, seconds(60))));
 
         ASSERT_THROW_MSG(mgr_->reportToStatsMgr(mond), BadValue,
-                        "reportToStatsMgr - duration previous interval is empty");
+                         "reportToStatsMgr - duration previous interval is empty!");
 
         mond->addSample(milliseconds(100));
         mond->addSample(milliseconds(250));
@@ -375,7 +373,7 @@ public:
         ASSERT_TRUE(before_alarm);
         EXPECT_EQ(Alarm::CLEAR, before_alarm->getState());
 
-        // 1.  Add two samples to the duratson inside the current interval
+        // 1. Add two samples to the duratson inside the current interval.
         // This should create the duration in the store.  Note both samples above
         // high-water-ms.
         ASSERT_NO_THROW_LOG(mgr_->addDurationSample(key, milliseconds(75)));
@@ -402,7 +400,7 @@ public:
         // Duration should have a current total of 95 ms, and a previous total of 160.
         checkDuration(__LINE__, key, 95, true, 160);
 
-        //  Should have one stat reported with a average value of 80.
+        // Should have one stat reported with a average value of 80.
         EXPECT_EQ(1, StatsMgr::instance().count());
         auto obs = StatsMgr::instance().getObservation(key->getStatName("average-ms"));
         ASSERT_TRUE(obs);
@@ -441,7 +439,7 @@ public:
         beforeAndAfterAlarm(__LINE__, before_alarm, Alarm::TRIGGERED, true);
         addString("reported average duration 00:00:00.100000 exceeds high-water-ms: 50");
 
-        //  Should have one stat reported with a value of 100.
+        // Should have one stat reported with a value of 100.
         EXPECT_EQ(1, StatsMgr::instance().count());
         obs = StatsMgr::instance().getObservation(key->getStatName("average-ms"));
         ASSERT_TRUE(obs);
@@ -459,9 +457,9 @@ public:
         // The Alarm should now be CLEAR since the newly completed interval is
         // below high water. The alarm should low-water report.
         beforeAndAfterAlarm(__LINE__, before_alarm, Alarm::CLEAR, false);
-        addString("reported average duration 00:00:00.010000 is now beloe low-water-ms: 25");
+        addString("reported average duration 00:00:00.010000 is now below low-water-ms: 25");
 
-        //  Should have one stat reported with a value of 10.
+        // Should have one stat reported with a value of 10.
         EXPECT_EQ(1, StatsMgr::instance().count());
         obs = StatsMgr::instance().getObservation(key->getStatName("average-ms"));
         ASSERT_TRUE(obs);