added support for onChange report

Report is now notified when metric changes and updates reading values.

Tested:
  - Added new unit tests
  - OnChange report updates Readings when metric values changes

Change-Id: I3be9ef7aa0486cb15bac627aa1de5cc632613b3b
Signed-off-by: Krzysztof Grobelny <krzysztof.grobelny@intel.com>
diff --git a/src/metrics/collection_function.hpp b/src/metrics/collection_function.hpp
new file mode 100644
index 0000000..610f015
--- /dev/null
+++ b/src/metrics/collection_function.hpp
@@ -0,0 +1,30 @@
+#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