Krzysztof Grobelny | dcc4e19 | 2021-03-08 09:09:34 +0000 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #include "types/collection_duration.hpp" |
| 4 | #include "types/collection_time_scope.hpp" |
| 5 | #include "types/operation_type.hpp" |
| 6 | |
| 7 | #include <string> |
| 8 | |
| 9 | class MetricParams final |
| 10 | { |
| 11 | public: |
| 12 | MetricParams& operationType(OperationType val) |
| 13 | { |
| 14 | operationTypeProperty = val; |
| 15 | return *this; |
| 16 | } |
| 17 | |
| 18 | const OperationType& operationType() const |
| 19 | { |
| 20 | return operationTypeProperty; |
| 21 | } |
| 22 | |
| 23 | MetricParams& id(std::string val) |
| 24 | { |
| 25 | idProperty = std::move(val); |
| 26 | return *this; |
| 27 | } |
| 28 | |
| 29 | const std::string& id() const |
| 30 | { |
| 31 | return idProperty; |
| 32 | } |
| 33 | |
| 34 | MetricParams& metadata(std::string val) |
| 35 | { |
| 36 | metadataProperty = std::move(val); |
| 37 | return *this; |
| 38 | } |
| 39 | |
| 40 | const std::string& metadata() const |
| 41 | { |
| 42 | return metadataProperty; |
| 43 | } |
| 44 | |
| 45 | MetricParams& collectionTimeScope(CollectionTimeScope val) |
| 46 | { |
| 47 | collectionTimeScopeProperty = val; |
| 48 | return *this; |
| 49 | } |
| 50 | |
| 51 | const CollectionTimeScope& collectionTimeScope() const |
| 52 | { |
| 53 | return collectionTimeScopeProperty; |
| 54 | } |
| 55 | |
| 56 | MetricParams& collectionDuration(CollectionDuration val) |
| 57 | { |
| 58 | collectionDurationProperty = val; |
| 59 | return *this; |
| 60 | } |
| 61 | |
| 62 | const CollectionDuration& collectionDuration() const |
| 63 | { |
| 64 | return collectionDurationProperty; |
| 65 | } |
| 66 | |
| 67 | private: |
| 68 | OperationType operationTypeProperty = {}; |
| 69 | std::string idProperty = "MetricId"; |
| 70 | std::string metadataProperty = "MetricMetadata"; |
| 71 | CollectionTimeScope collectionTimeScopeProperty = {}; |
| 72 | CollectionDuration collectionDurationProperty = |
| 73 | CollectionDuration(Milliseconds(0u)); |
| 74 | }; |