39 this->startTime_ = previous.timestamp();
40 this->endTime_ = current.timestamp();
41 this->timestamp_ = this->startTime_ + (this->endTime_ - this->startTime_) / 2;
43 this->sources_.forEach([&](
auto& source,
size_t sourceIndex) {
44 if ((*this->sourceInterests_)[sourceIndex].any())
45 source.computeDiff((*this->sourceInterests_)[sourceIndex], this->sourceIterators_[sourceIndex].first,
std::chrono::system_clock::time_point startTime_
Time of earlier metrics.
std::shared_ptr< std::vector< MetricsSource::Interests > > SourceInterests
Type used to store and share interests of multiple sources.
void computeDiff(MetricsArray< DataValueType > ¤t, MetricsArray< DataValueType > &previous, double factor) noexcept
Compute and store the differences between two Metrics Data Arrays.
Generic class to store and manage metrics.
const std::chrono::system_clock::time_point & endTime() const noexcept
Get time of latest metrics.
const std::chrono::system_clock::time_point & startTime() const noexcept
Get time of earlier metrics.
std::chrono::system_clock::time_point endTime_
Time of latest metrics.
MetricsDiffArray() noexcept
Construct a new Metrics Diff Array object.