@@ -77,24 +77,24 @@ TEST_P(WritableMetricStorageTestFixture, TestAggregation)
77
77
storage.RecordLong (measurements1,
78
78
opentelemetry::common::SystemTimestamp (std::chrono::system_clock::now ()));
79
79
80
- storage.Collect (collector. get (), collectors, sdk_start_ts, collection_ts,
81
- [&](const MetricData data ) {
82
- for (auto data_attr : data .point_data_attr_ )
83
- {
84
- auto data = opentelemetry::nostd::get<SumPointData>(data_attr.point_data );
85
- if (opentelemetry::nostd::get<std::string>(
86
- data_attr.attributes .find (" RequestType" )->second ) == " GET" )
87
- {
88
- EXPECT_EQ (opentelemetry::nostd::get<long >(data.value_ ), get_count1);
89
- }
90
- else if (opentelemetry::nostd::get<std::string>(
91
- data_attr.attributes .find (" RequestType" )->second ) == " PUT" )
92
- {
93
- EXPECT_EQ (opentelemetry::nostd::get<long >(data.value_ ), put_count1);
94
- }
95
- }
96
- return true ;
97
- });
80
+ storage.Collect (
81
+ collector. get (), collectors, sdk_start_ts, collection_ts, [&](const MetricData &metric_data ) {
82
+ for (const auto & data_attr : metric_data .point_data_attr_ )
83
+ {
84
+ const auto & data = opentelemetry::nostd::get<SumPointData>(data_attr.point_data );
85
+ if (opentelemetry::nostd::get<std::string>(
86
+ data_attr.attributes .find (" RequestType" )->second ) == " GET" )
87
+ {
88
+ EXPECT_EQ (opentelemetry::nostd::get<long >(data.value_ ), get_count1);
89
+ }
90
+ else if (opentelemetry::nostd::get<std::string>(
91
+ data_attr.attributes .find (" RequestType" )->second ) == " PUT" )
92
+ {
93
+ EXPECT_EQ (opentelemetry::nostd::get<long >(data.value_ ), put_count1);
94
+ }
95
+ }
96
+ return true ;
97
+ });
98
98
// subsequent recording after collection shouldn't fail
99
99
// monotonic increasing values;
100
100
long get_count2 = 50l ;
@@ -105,10 +105,10 @@ TEST_P(WritableMetricStorageTestFixture, TestAggregation)
105
105
storage.RecordLong (measurements2,
106
106
opentelemetry::common::SystemTimestamp (std::chrono::system_clock::now ()));
107
107
storage.Collect (
108
- collector.get (), collectors, sdk_start_ts, collection_ts, [&](const MetricData data ) {
109
- for (auto data_attr : data .point_data_attr_ )
108
+ collector.get (), collectors, sdk_start_ts, collection_ts, [&](const MetricData &metric_data ) {
109
+ for (const auto & data_attr : metric_data .point_data_attr_ )
110
110
{
111
- auto data = opentelemetry::nostd::get<SumPointData>(data_attr.point_data );
111
+ const auto & data = opentelemetry::nostd::get<SumPointData>(data_attr.point_data );
112
112
if (opentelemetry::nostd::get<std::string>(
113
113
data_attr.attributes .find (" RequestType" )->second ) == " GET" )
114
114
{
@@ -171,8 +171,8 @@ TEST_P(WritableMetricStorageTestObservableGaugeFixture, TestAggregation)
171
171
opentelemetry::common::SystemTimestamp (std::chrono::system_clock::now ()));
172
172
173
173
storage.Collect (
174
- collector.get (), collectors, sdk_start_ts, collection_ts, [&](const MetricData data ) {
175
- for (auto data_attr : data .point_data_attr_ )
174
+ collector.get (), collectors, sdk_start_ts, collection_ts, [&](const MetricData metric_data ) {
175
+ for (auto data_attr : metric_data .point_data_attr_ )
176
176
{
177
177
auto data = opentelemetry::nostd::get<LastValuePointData>(data_attr.point_data );
178
178
if (opentelemetry::nostd::get<std::string>(data_attr.attributes .find (" CPU" )->second ) ==
@@ -197,8 +197,8 @@ TEST_P(WritableMetricStorageTestObservableGaugeFixture, TestAggregation)
197
197
storage.RecordLong (measurements2,
198
198
opentelemetry::common::SystemTimestamp (std::chrono::system_clock::now ()));
199
199
storage.Collect (
200
- collector.get (), collectors, sdk_start_ts, collection_ts, [&](const MetricData data ) {
201
- for (auto data_attr : data .point_data_attr_ )
200
+ collector.get (), collectors, sdk_start_ts, collection_ts, [&](const MetricData metric_data ) {
201
+ for (auto data_attr : metric_data .point_data_attr_ )
202
202
{
203
203
auto data = opentelemetry::nostd::get<LastValuePointData>(data_attr.point_data );
204
204
if (opentelemetry::nostd::get<std::string>(data_attr.attributes .find (" CPU" )->second ) ==
0 commit comments