blob: f6e547ed750d5f2c0f95fb9625fea53707059077 [file] [log] [blame]
Krzysztof Grobelnyc8e3a642020-10-23 12:29:16 +02001#pragma once
2
Wludzik, Jozefe2362792020-10-27 17:23:55 +01003#include "report_manager.hpp"
Krzysztof Grobelnydcc4e192021-03-08 09:09:34 +00004#include "types/report_types.hpp"
Wludzik, Jozefe2362792020-10-27 17:23:55 +01005
Krzysztof Grobelnyc8e3a642020-10-23 12:29:16 +02006#include <chrono>
7#include <string>
8
9class ReportParams final
10{
11 public:
Krzysztof Grobelnyb8cc78d2021-11-29 15:54:53 +010012 ReportParams& reportId(std::string val)
13 {
14 reportIdProperty = std::move(val);
15 return *this;
16 }
17
18 const std::string& reportId() const
19 {
20 return reportIdProperty;
21 }
22
Krzysztof Grobelnyc8e3a642020-10-23 12:29:16 +020023 ReportParams& reportName(std::string val)
24 {
25 reportNameProperty = std::move(val);
26 return *this;
27 }
28
29 const std::string& reportName() const
30 {
31 return reportNameProperty;
32 }
33
Krzysztof Grobelny51497a02021-11-09 14:56:22 +010034 ReportParams& reportingType(const ReportingType val)
Krzysztof Grobelnyc8e3a642020-10-23 12:29:16 +020035 {
Krzysztof Grobelny51497a02021-11-09 14:56:22 +010036 reportingTypeProperty = val;
Krzysztof Grobelnyc8e3a642020-10-23 12:29:16 +020037 return *this;
38 }
39
Krzysztof Grobelny51497a02021-11-09 14:56:22 +010040 ReportingType reportingType() const
Krzysztof Grobelnyc8e3a642020-10-23 12:29:16 +020041 {
42 return reportingTypeProperty;
43 }
44
Krzysztof Grobelny51497a02021-11-09 14:56:22 +010045 ReportParams& reportActions(std::vector<ReportAction> val)
Wludzik, Jozefe2362792020-10-27 17:23:55 +010046 {
Krzysztof Grobelny51497a02021-11-09 14:56:22 +010047 reportActionsProperty = std::move(val);
Wludzik, Jozefe2362792020-10-27 17:23:55 +010048 return *this;
49 }
50
Krzysztof Grobelny51497a02021-11-09 14:56:22 +010051 std::vector<ReportAction> reportActions() const
Wludzik, Jozefe2362792020-10-27 17:23:55 +010052 {
Krzysztof Grobelny51497a02021-11-09 14:56:22 +010053 return reportActionsProperty;
Wludzik, Jozefe2362792020-10-27 17:23:55 +010054 }
55
Krzysztof Grobelnydcc4e192021-03-08 09:09:34 +000056 ReportParams& interval(Milliseconds val)
Wludzik, Jozefe2362792020-10-27 17:23:55 +010057 {
58 intervalProperty = val;
59 return *this;
60 }
61
Krzysztof Grobelnydcc4e192021-03-08 09:09:34 +000062 Milliseconds interval() const
Wludzik, Jozefe2362792020-10-27 17:23:55 +010063 {
64 return intervalProperty;
65 }
66
Lukasz Kazmierczak7e098e92021-09-16 15:59:56 +020067 ReportParams& enabled(bool val)
68 {
69 enabledProperty = val;
70 return *this;
71 }
72
73 bool enabled() const
74 {
75 return enabledProperty;
76 }
77
Szymon Dompke3eb56862021-09-20 15:32:04 +020078 ReportParams& appendLimit(uint64_t val)
79 {
80 appendLimitProperty = val;
81 return *this;
82 }
83
84 uint64_t appendLimit() const
85 {
86 return appendLimitProperty;
87 }
88
Krzysztof Grobelny51497a02021-11-09 14:56:22 +010089 ReportParams& reportUpdates(ReportUpdates val)
Szymon Dompke3eb56862021-09-20 15:32:04 +020090 {
91 reportUpdatesProperty = val;
92 return *this;
93 }
94
Krzysztof Grobelny51497a02021-11-09 14:56:22 +010095 ReportUpdates reportUpdates() const
Szymon Dompke3eb56862021-09-20 15:32:04 +020096 {
97 return reportUpdatesProperty;
98 }
99
Krzysztof Grobelnydcc4e192021-03-08 09:09:34 +0000100 ReportParams& metricParameters(std::vector<LabeledMetricParameters> val)
Wludzik, Jozefe2362792020-10-27 17:23:55 +0100101 {
Krzysztof Grobelnydcc4e192021-03-08 09:09:34 +0000102 metricParametersProperty = std::move(val);
Wludzik, Jozefe2362792020-10-27 17:23:55 +0100103 return *this;
104 }
105
Krzysztof Grobelnydcc4e192021-03-08 09:09:34 +0000106 const std::vector<LabeledMetricParameters>& metricParameters() const
Wludzik, Jozefe2362792020-10-27 17:23:55 +0100107 {
Krzysztof Grobelnydcc4e192021-03-08 09:09:34 +0000108 return metricParametersProperty;
Wludzik, Jozefe2362792020-10-27 17:23:55 +0100109 }
110
Szymon Dompkeb4ef22e2022-02-07 15:15:12 +0100111 ReportParams& triggerIds(std::vector<std::string> val)
112 {
113 triggerIdsProperty = std::move(val);
114 return *this;
115 }
116
117 std::vector<std::string> triggerIds() const
118 {
119 return triggerIdsProperty;
120 }
121
Wludzik, Jozefe2362792020-10-27 17:23:55 +0100122 private:
Krzysztof Grobelnyb8cc78d2021-11-29 15:54:53 +0100123 std::string reportIdProperty = "TestId";
Krzysztof Grobelnyc8e3a642020-10-23 12:29:16 +0200124 std::string reportNameProperty = "TestReport";
Krzysztof Grobelny51497a02021-11-09 14:56:22 +0100125 ReportingType reportingTypeProperty = ReportingType::onRequest;
126 std::vector<ReportAction> reportActionsProperty;
Krzysztof Grobelnydcc4e192021-03-08 09:09:34 +0000127 Milliseconds intervalProperty = ReportManager::minInterval;
Szymon Dompke3eb56862021-09-20 15:32:04 +0200128 uint64_t appendLimitProperty = 123;
Krzysztof Grobelny51497a02021-11-09 14:56:22 +0100129 ReportUpdates reportUpdatesProperty = ReportUpdates::overwrite;
Krzysztof Grobelnydcc4e192021-03-08 09:09:34 +0000130 std::vector<LabeledMetricParameters> metricParametersProperty{
131 {LabeledMetricParameters{
Szymon Dompke94f71c52021-12-10 07:16:33 +0100132 {LabeledSensorInfo{"Service",
133 "/xyz/openbmc_project/sensors/power/p1",
134 "metadata1"}},
Krzysztof Grobelnydcc4e192021-03-08 09:09:34 +0000135 OperationType::single,
136 "MetricId1",
Krzysztof Grobelnydcc4e192021-03-08 09:09:34 +0000137 CollectionTimeScope::point,
138 CollectionDuration(Milliseconds(0u))},
139 LabeledMetricParameters{
Szymon Dompke94f71c52021-12-10 07:16:33 +0100140 {LabeledSensorInfo{"Service",
141 "/xyz/openbmc_project/sensors/power/p2",
142 "metadata2"}},
Krzysztof Grobelnydcc4e192021-03-08 09:09:34 +0000143 OperationType::single,
144 "MetricId2",
Krzysztof Grobelnydcc4e192021-03-08 09:09:34 +0000145 CollectionTimeScope::point,
146 CollectionDuration(Milliseconds(0u))}}};
Szymon Dompkeb4ef22e2022-02-07 15:15:12 +0100147 std::vector<std::string> triggerIdsProperty{};
Lukasz Kazmierczak7e098e92021-09-16 15:59:56 +0200148 bool enabledProperty = true;
Krzysztof Grobelnyd2238192020-12-02 09:27:28 +0000149};