diff --git a/sdk/include/opentelemetry/sdk/metrics/view/attributes_processor.h b/sdk/include/opentelemetry/sdk/metrics/view/attributes_processor.h index fdc4e35c53..d82607357f 100644 --- a/sdk/include/opentelemetry/sdk/metrics/view/attributes_processor.h +++ b/sdk/include/opentelemetry/sdk/metrics/view/attributes_processor.h @@ -23,6 +23,8 @@ class AttributesProcessor // @returns The processed attributes virtual MetricAttributes process( const opentelemetry::common::KeyValueIterable &attributes) const noexcept = 0; + + virtual ~AttributesProcessor() = default; }; /** diff --git a/sdk/src/metrics/meter.cc b/sdk/src/metrics/meter.cc index e7ca822b6d..d5af7f9ec9 100644 --- a/sdk/src/metrics/meter.cc +++ b/sdk/src/metrics/meter.cc @@ -206,7 +206,7 @@ std::unique_ptr Meter::RegisterMetricStorage( "[Meter::RegisterMetricStorage] - Error during finding matching views." << "Some of the matching view configurations mayn't be used for metric collection"); } - return std::move(storages); + return storages; } /** collect metrics across all the meters **/ diff --git a/sdk/test/metrics/attributes_hashmap_benchmark.cc b/sdk/test/metrics/attributes_hashmap_benchmark.cc index 68160aa579..38d515a7ea 100644 --- a/sdk/test/metrics/attributes_hashmap_benchmark.cc +++ b/sdk/test/metrics/attributes_hashmap_benchmark.cc @@ -27,13 +27,12 @@ void BM_AttributseHashMap(benchmark::State &state) std::function()> create_default_aggregation = []() -> std::unique_ptr { - auto agg = std::unique_ptr(new DropAggregation); - return std::move(agg); + return std::unique_ptr(new DropAggregation); }; while (state.KeepRunning()) { - for (int i = 0; i < MAX_THREADS; i++) + for (size_t i = 0; i < MAX_THREADS; i++) { workers.push_back(std::thread([&]() { hash_map.GetOrSetDefault(attributes[i % 2], create_default_aggregation)->Aggregate(1l); diff --git a/sdk/test/metrics/attributes_hashmap_test.cc b/sdk/test/metrics/attributes_hashmap_test.cc index 454ece1ea0..610744c8e1 100644 --- a/sdk/test/metrics/attributes_hashmap_test.cc +++ b/sdk/test/metrics/attributes_hashmap_test.cc @@ -49,8 +49,7 @@ TEST(AttributesHashMap, BasicTests) // GetOrSetDefault std::function()> create_default_aggregation = []() -> std::unique_ptr { - auto agg = std::unique_ptr(new DropAggregation); - return std::move(agg); + return std::unique_ptr(new DropAggregation); }; MetricAttributes m4 = {{"k1", "v1"}, {"k2", "v2"}, {"k3", "v3"}}; EXPECT_NO_THROW(hash_map.GetOrSetDefault(m4, create_default_aggregation)->Aggregate(1l));