blob: 610f015f8831768cf17361d4176d90f9c95047d7 [file] [log] [blame]
#pragma once
#include "types/duration_types.hpp"
#include "types/operation_type.hpp"
#include <cstdint>
#include <memory>
#include <utility>
#include <vector>
namespace metrics
{
using ReadingItem = std::pair<Milliseconds, double>;
class CollectionFunction
{
public:
virtual ~CollectionFunction() = default;
virtual double calculate(const std::vector<ReadingItem>& readings,
Milliseconds timestamp) const = 0;
virtual double
calculateForStartupInterval(std::vector<ReadingItem>& readings,
Milliseconds timestamp) const = 0;
};
std::shared_ptr<CollectionFunction> makeCollectionFunction(OperationType);
} // namespace metrics