MetroCollect  2.3.4
MetricsDiffArray.h
Go to the documentation of this file.
1 //
2 // MetricsDiffArray.h
3 //
4 // Created on July 18th 2018
5 //
6 // Copyright 2018 CFM (www.cfm.fr)
7 //
8 // Licensed under the Apache License, Version 2.0 (the "License");
9 // you may not use this file except in compliance with the License.
10 // You may obtain a copy of the License at
11 //
12 // http://www.apache.org/licenses/LICENSE-2.0
13 //
14 // Unless required by applicable law or agreed to in writing, software
15 // distributed under the License is distributed on an "AS IS" BASIS,
16 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 // See the License for the specific language governing permissions and
18 // limitations under the License.
19 //
20 
21 #pragma once
22 
23 #include "MetricsArray.h"
24 
25 
26 namespace MetroCollect {
30  class MetricsDiffArray : public MetricsArray<DiffValueType> {
31  protected:
32  std::chrono::system_clock::time_point startTime_;
33  std::chrono::system_clock::time_point endTime_;
34 
35  public:
39  MetricsDiffArray() noexcept;
40 
46  explicit MetricsDiffArray(MetricsSource::SourceInterests sourceInterests) noexcept;
47 
48 
54  const std::chrono::system_clock::time_point& startTime() const noexcept;
55 
56 
62  const std::chrono::system_clock::time_point& endTime() const noexcept;
63 
64 
72  void computeDiff(MetricsArray<DataValueType>& current, MetricsArray<DataValueType>& previous, double factor) noexcept;
73  };
74 }
MetricsSource::SourceInterests sourceInterests() const noexcept
Returns the source interests.
Definition: MetricsArray.cc:57
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.
STL namespace.
void computeDiff(MetricsArray< DataValueType > &current, MetricsArray< DataValueType > &previous, double factor) noexcept
Compute and store the differences between two Metrics Data Arrays.
Generic class to store and manage metrics.
Definition: MetricsArray.h:40
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.
int64_t DataValueType
Type of fetched raw metrics.
Definition: MetricTypes.h:28
std::chrono::system_clock::time_point endTime_
Time of latest metrics.
Class to compute and store metric values variations.
MetricsDiffArray() noexcept
Construct a new Metrics Diff Array object.