From: Franciszek Gorski Date: Thu, 6 Jun 2019 17:28:30 +0000 (+0200) Subject: Support for storing more than one samples X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f0bf60e4f6125214f0ff8d8dfc7b243d57360b98;p=thirdparty%2Fkea.git Support for storing more than one samples --- diff --git a/src/lib/stats/observation.cc b/src/lib/stats/observation.cc index badd1f86b5..582625a7e6 100644 --- a/src/lib/stats/observation.cc +++ b/src/lib/stats/observation.cc @@ -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; diff --git a/src/lib/stats/tests/observation_unittest.cc b/src/lib/stats/tests/observation_unittest.cc index 1681dcdc34..82f362e906 100644 --- a/src/lib/stats/tests/observation_unittest.cc +++ b/src/lib/stats/tests/observation_unittest.cc @@ -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));