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;
tmp << "integer";
break;
case STAT_FLOAT:
- tmp << "float";
- break;
+ tmp << "float"; break;
case STAT_DURATION:
tmp << "duration";
break;
isc::data::ConstElementPtr
Observation::getJSON() const {
-
ElementPtr entry = isc::data::Element::createList(); // multiple observations
ElementPtr value;
ElementPtr timestamp;
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));