From 78eeadd042fb5357090d1399d259eb3c819b16ee Mon Sep 17 00:00:00 2001 From: Oblivion Date: Sun, 17 Jul 2022 12:25:27 +0000 Subject: [PATCH 1/2] fix compiler warnings --- .../opentelemetry/sdk/metrics/view/attributes_processor.h | 1 + sdk/src/metrics/metric_reader.cc | 2 +- sdk/src/metrics/state/sync_metric_storage.cc | 1 - sdk/test/metrics/async_metric_storage_test.cc | 2 -- 4 files changed, 2 insertions(+), 4 deletions(-) diff --git a/sdk/include/opentelemetry/sdk/metrics/view/attributes_processor.h b/sdk/include/opentelemetry/sdk/metrics/view/attributes_processor.h index fdc4e35c53..a267529734 100644 --- a/sdk/include/opentelemetry/sdk/metrics/view/attributes_processor.h +++ b/sdk/include/opentelemetry/sdk/metrics/view/attributes_processor.h @@ -23,6 +23,7 @@ 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/metric_reader.cc b/sdk/src/metrics/metric_reader.cc index c8d6de8967..2f44705e0e 100644 --- a/sdk/src/metrics/metric_reader.cc +++ b/sdk/src/metrics/metric_reader.cc @@ -14,7 +14,7 @@ namespace metrics { MetricReader::MetricReader(AggregationTemporality aggregation_temporality) - : aggregation_temporality_(aggregation_temporality), shutdown_(false), metric_producer_(nullptr) + : metric_producer_(nullptr), aggregation_temporality_(aggregation_temporality), shutdown_(false) {} void MetricReader::SetMetricProducer(MetricProducer *metric_producer) diff --git a/sdk/src/metrics/state/sync_metric_storage.cc b/sdk/src/metrics/state/sync_metric_storage.cc index 8c79f9d7ca..844b187c03 100644 --- a/sdk/src/metrics/state/sync_metric_storage.cc +++ b/sdk/src/metrics/state/sync_metric_storage.cc @@ -18,7 +18,6 @@ bool SyncMetricStorage::Collect(CollectorHandle *collector, nostd::function_ref callback) noexcept { opentelemetry::common::SystemTimestamp last_collection_ts = sdk_start_ts; - auto aggregation_temporarily = collector->GetAggregationTemporality(); // Add the current delta metrics to `unreported metrics stash` for all the collectors, // this will also empty the delta metrics hashmap, and make it available for diff --git a/sdk/test/metrics/async_metric_storage_test.cc b/sdk/test/metrics/async_metric_storage_test.cc index 2be5332a8d..5a51b6eda1 100644 --- a/sdk/test/metrics/async_metric_storage_test.cc +++ b/sdk/test/metrics/async_metric_storage_test.cc @@ -93,9 +93,7 @@ TEST_P(WritableMetricStorageTestFixture, TestAggregation) std::vector> collectors; collectors.push_back(collector); size_t count_attributes = 0; - long value = 0; - MeasurementFetcher measurement_fetcher; opentelemetry::sdk::metrics::AsyncMetricStorage storage(instr_desc, AggregationType::kSum, MeasurementFetcher::Fetcher, new DefaultAttributesProcessor()); From 985c0b4e818b8b0c8d45a86768e98380e1cc4fc2 Mon Sep 17 00:00:00 2001 From: Oblivion Date: Sun, 17 Jul 2022 13:54:14 +0000 Subject: [PATCH 2/2] format --- .../opentelemetry/sdk/metrics/view/attributes_processor.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/include/opentelemetry/sdk/metrics/view/attributes_processor.h b/sdk/include/opentelemetry/sdk/metrics/view/attributes_processor.h index a267529734..ebd22b79b4 100644 --- a/sdk/include/opentelemetry/sdk/metrics/view/attributes_processor.h +++ b/sdk/include/opentelemetry/sdk/metrics/view/attributes_processor.h @@ -23,7 +23,7 @@ class AttributesProcessor // @returns The processed attributes virtual MetricAttributes process( const opentelemetry::common::KeyValueIterable &attributes) const noexcept = 0; - virtual ~AttributesProcessor() = default; + virtual ~AttributesProcessor() = default; }; /**