From fba16c6c44645543567a8f94896f809e224a2211 Mon Sep 17 00:00:00 2001 From: Ehsan Saei <71217171+esigo@users.noreply.github.com> Date: Sun, 17 Jul 2022 20:26:57 +0200 Subject: [PATCH] fix compiler warnings (#1499) * fix compiler warnings * format --- .../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..ebd22b79b4 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());