Krzysztof Grobelny | 8069771 | 2021-03-04 09:49:27 +0000 | [diff] [blame] | 1 | #pragma once |
| 2 | |
Krzysztof Grobelny | 51f0fd5 | 2021-12-28 16:32:08 +0100 | [diff] [blame] | 3 | #include "types/duration_types.hpp" |
Krzysztof Grobelny | 8069771 | 2021-03-04 09:49:27 +0000 | [diff] [blame] | 4 | #include "types/operation_type.hpp" |
| 5 | |
| 6 | #include <cstdint> |
| 7 | #include <memory> |
| 8 | #include <utility> |
| 9 | #include <vector> |
| 10 | |
Krzysztof Grobelny | f7ea299 | 2022-01-27 11:04:58 +0100 | [diff] [blame^] | 11 | namespace metrics |
Krzysztof Grobelny | 8069771 | 2021-03-04 09:49:27 +0000 | [diff] [blame] | 12 | { |
| 13 | |
Krzysztof Grobelny | 51f0fd5 | 2021-12-28 16:32:08 +0100 | [diff] [blame] | 14 | using ReadingItem = std::pair<Milliseconds, double>; |
Krzysztof Grobelny | 8069771 | 2021-03-04 09:49:27 +0000 | [diff] [blame] | 15 | |
| 16 | class CollectionFunction |
| 17 | { |
| 18 | public: |
| 19 | virtual ~CollectionFunction() = default; |
| 20 | |
Krzysztof Grobelny | 51f0fd5 | 2021-12-28 16:32:08 +0100 | [diff] [blame] | 21 | virtual double calculate(const std::vector<ReadingItem>& readings, |
| 22 | Milliseconds timestamp) const = 0; |
| 23 | virtual double |
Krzysztof Grobelny | 8069771 | 2021-03-04 09:49:27 +0000 | [diff] [blame] | 24 | calculateForStartupInterval(std::vector<ReadingItem>& readings, |
Krzysztof Grobelny | 51f0fd5 | 2021-12-28 16:32:08 +0100 | [diff] [blame] | 25 | Milliseconds timestamp) const = 0; |
Krzysztof Grobelny | 8069771 | 2021-03-04 09:49:27 +0000 | [diff] [blame] | 26 | }; |
| 27 | |
| 28 | std::shared_ptr<CollectionFunction> makeCollectionFunction(OperationType); |
| 29 | |
Krzysztof Grobelny | f7ea299 | 2022-01-27 11:04:58 +0100 | [diff] [blame^] | 30 | } // namespace metrics |