]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
Support for storing more than one samples
authorFranciszek Gorski <fagorski9@gmail.com>
Thu, 6 Jun 2019 17:28:30 +0000 (19:28 +0200)
committerRazvan Becheriu <razvan@isc.org>
Mon, 15 Jul 2019 12:37:57 +0000 (15:37 +0300)
src/lib/stats/observation.cc
src/lib/stats/tests/observation_unittest.cc

index badd1f86b59a92dbe23e82efab427150934babdd..582625a7e6ef5b13db19298bf97b9b149c8bcb33 100644 (file)
@@ -317,8 +317,7 @@ std::string Observation::typeToText(Type type) {
         tmp << "integer";
         break;
     case STAT_FLOAT:
-        tmp << "float";
-        break;
+        tmp << "float";        break;
     case STAT_DURATION:
         tmp << "duration";
         break;
index 1681dcdc3412300cdcc4eb34b1707026d45fdc47..82f362e906bda89277d87f6f87b39d65320bbca6 100644 (file)
@@ -497,6 +497,10 @@ TEST_F(ObservationTest, durationToJSON) {
     std::string first_sample = ", \"01:02:03.000004\", \"" +
         isc::util::ptimeToText(c.getDuration().second) + "\" ] ]";
 
+    // String which contains first added sample
+    std::string first_sample = ", \"01:02:03.000004\", \""
+        + isc::util::ptimeToText(c.getDuration().second) + "\" ] ]";
+
     // 1 hour 2 minutes 3 seconds and 4 milliseconds
     c.setValue(time_duration(1, 2, 3, 4));