]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
Support for storing more than one samples
authorFranciszek Gorski <fagorski9@gmail.com>
Wed, 19 Jun 2019 13:22:51 +0000 (15:22 +0200)
committerRazvan Becheriu <razvan@isc.org>
Mon, 15 Jul 2019 12:25:41 +0000 (15:25 +0300)
src/lib/stats/observation.cc
src/lib/stats/observation.h

index 3e7417386a9efab49ab8a7c585d3b5ac9574fc55..7d961542a06bc3ca008cca8e26d2a0c2018f8653 100644 (file)
@@ -188,7 +188,7 @@ void Observation::setValueInternal(SampleType value, StorageType& storage,
                 storage.front().second - storage.back().second;
             // removing samples until the range_of_storage
             // stops exceeding the duration limit
-            while (range_of_storage >= max_sample_age.second) {
+            while (range_of_storage > max_sample_age.second) {
                 storage.pop_back();
                 range_of_storage =
                     storage.front().second - storage.back().second;
index 087eca91e0c5ad287b53e146058772db5951d311..0fa2b7f43956c44af138aa8aa95f85a5a599d27e 100644 (file)
@@ -303,7 +303,7 @@ private:
     /// @brief Returns samples (internal version)
     ///
     /// @tparam SampleType type of samples (e.g. IntegerSample)
-    /// @tparam StorageType type of storage (e.g. list<IntegerSample>)
+    /// @tparam Storage type of storage (e.g. list<IntegerSample>)
     /// @param observation storage
     /// @param exp_type expected observation type (used for sanity checking)
     /// @throw InvalidStatType if observation type mismatches
@@ -332,7 +332,6 @@ private:
     void setMaxSampleCountInternal(StorageType& storage,
                                    uint32_t max_samples, Type exp_type);
 
-
     /// @brief Observation (statistic) name
     std::string name_;