diff --git a/CHANGELOG.md b/CHANGELOG.md index a258f6d15e..6186ab0fd1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -54,6 +54,9 @@ Increment the: * [EXPORTER] Allow custom HttpClient in OTLP HTTP [#3930](https://github.com/open-telemetry/opentelemetry-cpp/pull/3930) +* [CODE HEALTH] Fix clang-tidy unnecessary value param warnings + [#3931](https://github.com/open-telemetry/opentelemetry-cpp/pull/3931) + Important changes: * [BUILD] Revisit EventLogger deprecation diff --git a/examples/grpc/tracer_common.h b/examples/grpc/tracer_common.h index 0bbbe49124..8e33ac8842 100644 --- a/examples/grpc/tracer_common.h +++ b/examples/grpc/tracer_common.h @@ -100,7 +100,8 @@ void CleanupTracer() opentelemetry::sdk::trace::Provider::SetTracerProvider(none); } -opentelemetry::nostd::shared_ptr get_tracer(std::string tracer_name) +opentelemetry::nostd::shared_ptr get_tracer( + const std::string &tracer_name) { auto provider = opentelemetry::trace::Provider::GetTracerProvider(); return provider->GetTracer(tracer_name); diff --git a/examples/http/tracer_common.h b/examples/http/tracer_common.h index edc56742bb..5bd3dcc57e 100644 --- a/examples/http/tracer_common.h +++ b/examples/http/tracer_common.h @@ -89,7 +89,8 @@ void CleanupTracer() opentelemetry::sdk::trace::Provider::SetTracerProvider(none); } -opentelemetry::nostd::shared_ptr get_tracer(std::string tracer_name) +opentelemetry::nostd::shared_ptr get_tracer( + const std::string &tracer_name) { auto provider = opentelemetry::trace::Provider::GetTracerProvider(); return provider->GetTracer(tracer_name); diff --git a/exporters/otlp/test/otlp_file_metric_exporter_test.cc b/exporters/otlp/test/otlp_file_metric_exporter_test.cc index fb388f316e..df4b5102e1 100644 --- a/exporters/otlp/test/otlp_file_metric_exporter_test.cc +++ b/exporters/otlp/test/otlp_file_metric_exporter_test.cc @@ -56,7 +56,7 @@ class ProtobufGlobalSymbolGuard }; template -static IntegerType JsonToInteger(nlohmann::json value) +static IntegerType JsonToInteger(const nlohmann::json &value) { if (value.is_string()) { diff --git a/exporters/otlp/test/otlp_grpc_exporter_test.cc b/exporters/otlp/test/otlp_grpc_exporter_test.cc index f7fb612394..3ac174b691 100644 --- a/exporters/otlp/test/otlp_grpc_exporter_test.cc +++ b/exporters/otlp/test/otlp_grpc_exporter_test.cc @@ -407,7 +407,8 @@ TEST_F(OtlpGrpcExporterTestPeer, ConfigRetryGenericValuesFromEnv) # ifdef ENABLE_OTLP_RETRY_PREVIEW struct TestTraceService : public opentelemetry::proto::collector::trace::v1::TraceService::Service { - TestTraceService(std::vector status_codes) : status_codes_(status_codes) {} + TestTraceService(const std::vector &status_codes) : status_codes_(status_codes) + {} inline grpc::Status Export( grpc::ServerContext *, diff --git a/exporters/otlp/test/otlp_grpc_metric_exporter_test.cc b/exporters/otlp/test/otlp_grpc_metric_exporter_test.cc index 429dd01b5c..89871626e4 100644 --- a/exporters/otlp/test/otlp_grpc_metric_exporter_test.cc +++ b/exporters/otlp/test/otlp_grpc_metric_exporter_test.cc @@ -67,7 +67,7 @@ class OtlpGrpcMetricExporterTestPeer : public ::testing::Test std::unique_ptr GetExporter( std::unique_ptr stub_interface, - std::shared_ptr client) + const std::shared_ptr &client) { return std::unique_ptr( new OtlpGrpcMetricExporter(std::move(stub_interface), std::move(client))); @@ -75,7 +75,7 @@ class OtlpGrpcMetricExporterTestPeer : public ::testing::Test std::unique_ptr GetExporter( const OtlpGrpcMetricExporterOptions &options, - std::shared_ptr client) + const std::shared_ptr &client) { return std::unique_ptr( new OtlpGrpcMetricExporter(options, std::move(client))); diff --git a/exporters/otlp/test/otlp_http_metric_exporter_test.cc b/exporters/otlp/test/otlp_http_metric_exporter_test.cc index cd3b89183c..2d33bf2b65 100644 --- a/exporters/otlp/test/otlp_http_metric_exporter_test.cc +++ b/exporters/otlp/test/otlp_http_metric_exporter_test.cc @@ -62,7 +62,7 @@ namespace otlp { template -static IntegerType JsonToInteger(nlohmann::json value) +static IntegerType JsonToInteger(const nlohmann::json &value) { if (value.is_string()) { diff --git a/exporters/prometheus/include/opentelemetry/exporters/prometheus/exporter_utils.h b/exporters/prometheus/include/opentelemetry/exporters/prometheus/exporter_utils.h index 496ec9bd34..87ab12fd0d 100644 --- a/exporters/prometheus/include/opentelemetry/exporters/prometheus/exporter_utils.h +++ b/exporters/prometheus/include/opentelemetry/exporters/prometheus/exporter_utils.h @@ -162,7 +162,7 @@ class PrometheusExporterUtils * Counter => Prometheus Counter */ template - static void SetData(std::vector values, + static void SetData(const std::vector &values, const opentelemetry::sdk::metrics::PointAttributes &labels, const opentelemetry::sdk::instrumentationscope::InstrumentationScope *scope, ::prometheus::MetricType type, @@ -175,7 +175,7 @@ class PrometheusExporterUtils * Histogram => Prometheus Histogram */ template - static void SetData(std::vector values, + static void SetData(const std::vector &values, const std::vector &boundaries, const std::vector &counts, const opentelemetry::sdk::metrics::PointAttributes &labels, diff --git a/exporters/prometheus/src/exporter_utils.cc b/exporters/prometheus/src/exporter_utils.cc index 7055e0d86c..718670dd58 100644 --- a/exporters/prometheus/src/exporter_utils.cc +++ b/exporters/prometheus/src/exporter_utils.cc @@ -641,7 +641,7 @@ void PrometheusExporterUtils::SetTarget( */ template void PrometheusExporterUtils::SetData( - std::vector values, + const std::vector &values, const metric_sdk::PointAttributes &labels, const opentelemetry::sdk::instrumentationscope::InstrumentationScope *scope, prometheus_client::MetricType type, @@ -661,7 +661,7 @@ void PrometheusExporterUtils::SetData( */ template void PrometheusExporterUtils::SetData( - std::vector values, + const std::vector &values, const std::vector &boundaries, const std::vector &counts, const metric_sdk::PointAttributes &labels, diff --git a/ext/include/opentelemetry/ext/http/server/http_server.h b/ext/include/opentelemetry/ext/http/server/http_server.h index 359a37062e..d556cba8ac 100644 --- a/ext/include/opentelemetry/ext/http/server/http_server.h +++ b/ext/include/opentelemetry/ext/http/server/http_server.h @@ -63,11 +63,11 @@ class HttpRequestCallback virtual ~HttpRequestCallback() = default; - HttpRequestCallback(CallbackFunction func) : callback(func) {} + HttpRequestCallback(CallbackFunction func) : callback(std::move(func)) {} HttpRequestCallback &operator=(CallbackFunction func) { - callback = func; + callback = std::move(func); return (*this); } @@ -133,7 +133,7 @@ class HttpServer : private SocketTools::Reactor::SocketCallback second = nullptr; } - HttpRequestHandler &operator=(std::pair other) + HttpRequestHandler &operator=(const std::pair &other) { first = other.first; second = other.second; diff --git a/ext/include/opentelemetry/ext/http/server/socket_tools.h b/ext/include/opentelemetry/ext/http/server/socket_tools.h index 4d5d60b418..17f8d8129d 100644 --- a/ext/include/opentelemetry/ext/http/server/socket_tools.h +++ b/ext/include/opentelemetry/ext/http/server/socket_tools.h @@ -439,7 +439,7 @@ struct SocketData SocketData() : socket(), flags(0) {} - bool operator==(Socket s) { return (socket == s); } + bool operator==(const Socket &s) { return (socket == s); } }; /// diff --git a/sdk/include/opentelemetry/sdk/instrumentationscope/scope_configurator.h b/sdk/include/opentelemetry/sdk/instrumentationscope/scope_configurator.h index 71bc61b6a3..8e3165badb 100644 --- a/sdk/include/opentelemetry/sdk/instrumentationscope/scope_configurator.h +++ b/sdk/include/opentelemetry/sdk/instrumentationscope/scope_configurator.h @@ -3,6 +3,7 @@ #pragma once #include +#include #include "opentelemetry/sdk/instrumentationscope/instrumentation_scope.h" #include "opentelemetry/version.h" @@ -48,7 +49,7 @@ class ScopeConfigurator Builder &AddCondition(std::function scope_matcher, T scope_config) { - conditions_.emplace_back(scope_matcher, scope_config); + conditions_.emplace_back(std::move(scope_matcher), scope_config); return *this; } @@ -135,7 +136,7 @@ class ScopeConfigurator private: // Prevent direct initialization of ScopeConfigurator objects. explicit ScopeConfigurator(std::function configurator) - : configurator_(configurator) + : configurator_(std::move(configurator)) {} std::function configurator_; diff --git a/sdk/include/opentelemetry/sdk/metrics/aggregation/default_aggregation.h b/sdk/include/opentelemetry/sdk/metrics/aggregation/default_aggregation.h index 70f6f8ee74..949e4be85b 100644 --- a/sdk/include/opentelemetry/sdk/metrics/aggregation/default_aggregation.h +++ b/sdk/include/opentelemetry/sdk/metrics/aggregation/default_aggregation.h @@ -63,7 +63,7 @@ class DefaultAggregation static std::unique_ptr CreateAggregation( AggregationType aggregation_type, - InstrumentDescriptor instrument_descriptor, + const InstrumentDescriptor &instrument_descriptor, const AggregationConfig *aggregation_config = nullptr) { switch (aggregation_type) diff --git a/sdk/include/opentelemetry/sdk/metrics/data/exemplar_data.h b/sdk/include/opentelemetry/sdk/metrics/data/exemplar_data.h index 59097185ee..8359c04075 100644 --- a/sdk/include/opentelemetry/sdk/metrics/data/exemplar_data.h +++ b/sdk/include/opentelemetry/sdk/metrics/data/exemplar_data.h @@ -26,7 +26,7 @@ using MetricAttributes = opentelemetry::sdk::metrics::FilteredOrderedAttributeMa class ExemplarData { public: - static ExemplarData Create(std::shared_ptr context, + static ExemplarData Create(const std::shared_ptr &context, const opentelemetry::common::SystemTimestamp ×tamp, const PointDataAttributes &point_data_attr) { @@ -68,7 +68,7 @@ class ExemplarData static PointType CreateDropPointData() { return DropPointData{}; } private: - ExemplarData(std::shared_ptr context, + ExemplarData(const std::shared_ptr &context, opentelemetry::common::SystemTimestamp timestamp, const PointDataAttributes &point_data_attr) : context_(*context.get()), timestamp_(timestamp), point_data_attr_(point_data_attr) diff --git a/sdk/include/opentelemetry/sdk/metrics/exemplar/aligned_histogram_bucket_exemplar_reservoir.h b/sdk/include/opentelemetry/sdk/metrics/exemplar/aligned_histogram_bucket_exemplar_reservoir.h index 2690493d7d..b42cd0021e 100644 --- a/sdk/include/opentelemetry/sdk/metrics/exemplar/aligned_histogram_bucket_exemplar_reservoir.h +++ b/sdk/include/opentelemetry/sdk/metrics/exemplar/aligned_histogram_bucket_exemplar_reservoir.h @@ -44,7 +44,7 @@ class AlignedHistogramBucketExemplarReservoir : public FixedSizeExemplarReservoi AlignedHistogramBucketExemplarReservoir( size_t size, - std::shared_ptr reservoir_cell_selector, + const std::shared_ptr &reservoir_cell_selector, MapAndResetCellType map_and_reset_cell) : FixedSizeExemplarReservoir(size + 1, reservoir_cell_selector, map_and_reset_cell) {} diff --git a/sdk/include/opentelemetry/sdk/metrics/exemplar/fixed_size_exemplar_reservoir.h b/sdk/include/opentelemetry/sdk/metrics/exemplar/fixed_size_exemplar_reservoir.h index 55f9ed876e..d33c46a8db 100644 --- a/sdk/include/opentelemetry/sdk/metrics/exemplar/fixed_size_exemplar_reservoir.h +++ b/sdk/include/opentelemetry/sdk/metrics/exemplar/fixed_size_exemplar_reservoir.h @@ -27,7 +27,7 @@ class FixedSizeExemplarReservoir : public ExemplarReservoir public: FixedSizeExemplarReservoir(size_t size, - std::shared_ptr reservoir_cell_selector, + const std::shared_ptr &reservoir_cell_selector, MapAndResetCellType map_and_reset_cell) : storage_(size), reservoir_cell_selector_(reservoir_cell_selector), diff --git a/sdk/include/opentelemetry/sdk/metrics/exemplar/reservoir.h b/sdk/include/opentelemetry/sdk/metrics/exemplar/reservoir.h index d618aee09f..efbd20abc4 100644 --- a/sdk/include/opentelemetry/sdk/metrics/exemplar/reservoir.h +++ b/sdk/include/opentelemetry/sdk/metrics/exemplar/reservoir.h @@ -79,12 +79,12 @@ class ExemplarReservoir static nostd::shared_ptr GetSimpleFixedSizeExemplarReservoir( size_t size, - std::shared_ptr reservoir_cell_selector, + const std::shared_ptr &reservoir_cell_selector, MapAndResetCellType map_and_reset_cell); static nostd::shared_ptr GetAlignedHistogramBucketExemplarReservoir( size_t size, - std::shared_ptr reservoir_cell_selector, + const std::shared_ptr &reservoir_cell_selector, MapAndResetCellType map_and_reset_cell); static nostd::shared_ptr GetNoExemplarReservoir(); diff --git a/sdk/include/opentelemetry/sdk/metrics/exemplar/simple_fixed_size_exemplar_reservoir.h b/sdk/include/opentelemetry/sdk/metrics/exemplar/simple_fixed_size_exemplar_reservoir.h index 99e659bf30..57f956d32a 100644 --- a/sdk/include/opentelemetry/sdk/metrics/exemplar/simple_fixed_size_exemplar_reservoir.h +++ b/sdk/include/opentelemetry/sdk/metrics/exemplar/simple_fixed_size_exemplar_reservoir.h @@ -43,9 +43,10 @@ class SimpleFixedSizeExemplarReservoir : public FixedSizeExemplarReservoir return std::shared_ptr{new SimpleFixedSizeCellSelector{size}}; } - SimpleFixedSizeExemplarReservoir(size_t size, - std::shared_ptr reservoir_cell_selector, - MapAndResetCellType map_and_reset_cell) + SimpleFixedSizeExemplarReservoir( + size_t size, + const std::shared_ptr &reservoir_cell_selector, + MapAndResetCellType map_and_reset_cell) : FixedSizeExemplarReservoir(size, reservoir_cell_selector, map_and_reset_cell) {} diff --git a/sdk/include/opentelemetry/sdk/metrics/export/metric_filter.h b/sdk/include/opentelemetry/sdk/metrics/export/metric_filter.h index 75f64b1e58..47d88c1088 100644 --- a/sdk/include/opentelemetry/sdk/metrics/export/metric_filter.h +++ b/sdk/include/opentelemetry/sdk/metrics/export/metric_filter.h @@ -63,13 +63,13 @@ class MetricFilter const PointAttributes &attributes)>; // static - static std::unique_ptr Create(TestMetricFn test_metric_fn, - TestAttributesFn test_attributes_fn) + static std::unique_ptr Create(const TestMetricFn &test_metric_fn, + const TestAttributesFn &test_attributes_fn) { return std::make_unique(test_metric_fn, test_attributes_fn); } - MetricFilter(TestMetricFn test_metric_fn, TestAttributesFn test_attributes_fn) + MetricFilter(const TestMetricFn &test_metric_fn, const TestAttributesFn &test_attributes_fn) : test_metric_fn_(test_metric_fn), test_attributes_fn_(test_attributes_fn) {} diff --git a/sdk/include/opentelemetry/sdk/metrics/state/async_metric_storage.h b/sdk/include/opentelemetry/sdk/metrics/state/async_metric_storage.h index 968de7aa82..740e1082f4 100644 --- a/sdk/include/opentelemetry/sdk/metrics/state/async_metric_storage.h +++ b/sdk/include/opentelemetry/sdk/metrics/state/async_metric_storage.h @@ -34,7 +34,7 @@ namespace metrics class AsyncMetricStorage : public MetricStorage, public AsyncWritableMetricStorage { public: - AsyncMetricStorage(InstrumentDescriptor instrument_descriptor, + AsyncMetricStorage(const InstrumentDescriptor &instrument_descriptor, const AggregationType aggregation_type, #ifdef ENABLE_METRICS_EXEMPLAR_PREVIEW ExemplarFilterType exempler_filter_type, diff --git a/sdk/include/opentelemetry/sdk/metrics/state/multi_metric_storage.h b/sdk/include/opentelemetry/sdk/metrics/state/multi_metric_storage.h index 2424daa153..38ebb52fe8 100644 --- a/sdk/include/opentelemetry/sdk/metrics/state/multi_metric_storage.h +++ b/sdk/include/opentelemetry/sdk/metrics/state/multi_metric_storage.h @@ -25,7 +25,7 @@ namespace metrics class SyncMultiMetricStorage : public SyncWritableMetricStorage { public: - void AddStorage(std::shared_ptr storage) + void AddStorage(const std::shared_ptr &storage) { storages_.push_back(storage); } @@ -73,7 +73,7 @@ class SyncMultiMetricStorage : public SyncWritableMetricStorage class AsyncMultiMetricStorage : public AsyncWritableMetricStorage { public: - void AddStorage(std::shared_ptr storage) + void AddStorage(const std::shared_ptr &storage) { storages_.push_back(storage); } diff --git a/sdk/include/opentelemetry/sdk/metrics/state/sync_metric_storage.h b/sdk/include/opentelemetry/sdk/metrics/state/sync_metric_storage.h index f517375fd8..11556e9a76 100644 --- a/sdk/include/opentelemetry/sdk/metrics/state/sync_metric_storage.h +++ b/sdk/include/opentelemetry/sdk/metrics/state/sync_metric_storage.h @@ -57,7 +57,7 @@ class SyncMetricStorage : public MetricStorage, public SyncWritableMetricStorage #endif // ENABLE_METRICS_EXEMPLAR_PREVIEW public: - SyncMetricStorage(InstrumentDescriptor instrument_descriptor, + SyncMetricStorage(const InstrumentDescriptor &instrument_descriptor, const AggregationType aggregation_type, std::shared_ptr attributes_processor, #ifdef ENABLE_METRICS_EXEMPLAR_PREVIEW diff --git a/sdk/include/opentelemetry/sdk/metrics/sync_instruments.h b/sdk/include/opentelemetry/sdk/metrics/sync_instruments.h index ff5eaeb282..74ef0f6b31 100644 --- a/sdk/include/opentelemetry/sdk/metrics/sync_instruments.h +++ b/sdk/include/opentelemetry/sdk/metrics/sync_instruments.h @@ -23,7 +23,7 @@ namespace metrics class Synchronous { public: - Synchronous(InstrumentDescriptor instrument_descriptor, + Synchronous(const InstrumentDescriptor &instrument_descriptor, std::unique_ptr storage) : instrument_descriptor_(instrument_descriptor), storage_(std::move(storage)) {} diff --git a/sdk/include/opentelemetry/sdk/metrics/view/view.h b/sdk/include/opentelemetry/sdk/metrics/view/view.h index 61152a3c63..e00faaed3f 100644 --- a/sdk/include/opentelemetry/sdk/metrics/view/view.h +++ b/sdk/include/opentelemetry/sdk/metrics/view/view.h @@ -25,9 +25,9 @@ class View { public: View(const std::string &name, - const std::string &description = "", - AggregationType aggregation_type = AggregationType::kDefault, - std::shared_ptr aggregation_config = nullptr, + const std::string &description = "", + AggregationType aggregation_type = AggregationType::kDefault, + const std::shared_ptr &aggregation_config = nullptr, std::unique_ptr attributes_processor = std::unique_ptr( new opentelemetry::sdk::metrics::DefaultAttributesProcessor())) diff --git a/sdk/include/opentelemetry/sdk/metrics/view/view_factory.h b/sdk/include/opentelemetry/sdk/metrics/view/view_factory.h index df3c966571..f6ecb93e0c 100644 --- a/sdk/include/opentelemetry/sdk/metrics/view/view_factory.h +++ b/sdk/include/opentelemetry/sdk/metrics/view/view_factory.h @@ -35,12 +35,12 @@ class OPENTELEMETRY_EXPORT ViewFactory static std::unique_ptr Create(const std::string &name, const std::string &description, AggregationType aggregation_type, - std::shared_ptr aggregation_config); + const std::shared_ptr &aggregation_config); static std::unique_ptr Create(const std::string &name, const std::string &description, AggregationType aggregation_type, - std::shared_ptr aggregation_config, + const std::shared_ptr &aggregation_config, std::unique_ptr attributes_processor); }; diff --git a/sdk/include/opentelemetry/sdk/trace/recordable.h b/sdk/include/opentelemetry/sdk/trace/recordable.h index fbd2ccd69e..4f6a895170 100644 --- a/sdk/include/opentelemetry/sdk/trace/recordable.h +++ b/sdk/include/opentelemetry/sdk/trace/recordable.h @@ -123,7 +123,7 @@ class Recordable * Add a link to a span with default (empty) attributes. * @param span_context the span context of the linked span */ - void AddLink(opentelemetry::trace::SpanContext span_context) + void AddLink(const opentelemetry::trace::SpanContext &span_context) { AddLink(span_context, opentelemetry::sdk::GetEmptyAttributes()); } diff --git a/sdk/include/opentelemetry/sdk/trace/span_data.h b/sdk/include/opentelemetry/sdk/trace/span_data.h index 96b8e5deee..79adf28dda 100644 --- a/sdk/include/opentelemetry/sdk/trace/span_data.h +++ b/sdk/include/opentelemetry/sdk/trace/span_data.h @@ -8,6 +8,7 @@ #include #include #include +#include #include #include "opentelemetry/common/attribute_value.h" @@ -40,7 +41,7 @@ class SpanDataEvent SpanDataEvent(std::string name, opentelemetry::common::SystemTimestamp timestamp, const opentelemetry::common::KeyValueIterable &attributes) - : name_(name), timestamp_(timestamp), attribute_map_(attributes) + : name_(std::move(name)), timestamp_(timestamp), attribute_map_(attributes) {} /** @@ -79,7 +80,7 @@ class SpanDataLink public: SpanDataLink(opentelemetry::trace::SpanContext span_context, const opentelemetry::common::KeyValueIterable &attributes) - : span_context_(span_context), attribute_map_(attributes) + : span_context_(std::move(span_context)), attribute_map_(attributes) {} /** diff --git a/sdk/src/metrics/exemplar/reservoir.cc b/sdk/src/metrics/exemplar/reservoir.cc index 2d8be1ec43..f5fe4064b6 100644 --- a/sdk/src/metrics/exemplar/reservoir.cc +++ b/sdk/src/metrics/exemplar/reservoir.cc @@ -4,7 +4,6 @@ #ifdef ENABLE_METRICS_EXEMPLAR_PREVIEW # include -# include # include "opentelemetry/nostd/shared_ptr.h" # include "opentelemetry/sdk/metrics/exemplar/aligned_histogram_bucket_exemplar_reservoir.h" @@ -23,20 +22,20 @@ namespace metrics nostd::shared_ptr ExemplarReservoir::GetSimpleFixedSizeExemplarReservoir( size_t size, - std::shared_ptr reservoir_cell_selector, + const std::shared_ptr &reservoir_cell_selector, MapAndResetCellType map_and_reset_cell) { - return nostd::shared_ptr{new SimpleFixedSizeExemplarReservoir{ - size, std::move(reservoir_cell_selector), map_and_reset_cell}}; + return nostd::shared_ptr{ + new SimpleFixedSizeExemplarReservoir{size, reservoir_cell_selector, map_and_reset_cell}}; } nostd::shared_ptr ExemplarReservoir::GetAlignedHistogramBucketExemplarReservoir( size_t size, - std::shared_ptr reservoir_cell_selector, + const std::shared_ptr &reservoir_cell_selector, MapAndResetCellType map_and_reset_cell) { return nostd::shared_ptr{new AlignedHistogramBucketExemplarReservoir{ - size, std::move(reservoir_cell_selector), map_and_reset_cell}}; + size, reservoir_cell_selector, map_and_reset_cell}}; } nostd::shared_ptr ExemplarReservoir::GetNoExemplarReservoir() diff --git a/sdk/src/metrics/view/view_factory.cc b/sdk/src/metrics/view/view_factory.cc index 13d4678ece..ae94c151ed 100644 --- a/sdk/src/metrics/view/view_factory.cc +++ b/sdk/src/metrics/view/view_factory.cc @@ -36,26 +36,27 @@ std::unique_ptr ViewFactory::Create(const std::string &name, return Create(name, description, aggregation_type, aggregation_config); } -std::unique_ptr ViewFactory::Create(const std::string &name, - const std::string &description, - AggregationType aggregation_type, - std::shared_ptr aggregation_config) +std::unique_ptr ViewFactory::Create( + const std::string &name, + const std::string &description, + AggregationType aggregation_type, + const std::shared_ptr &aggregation_config) { auto attributes_processor = std::unique_ptr(new DefaultAttributesProcessor()); - return Create(name, description, aggregation_type, std::move(aggregation_config), + return Create(name, description, aggregation_type, aggregation_config, std::move(attributes_processor)); } -std::unique_ptr ViewFactory::Create(const std::string &name, - const std::string &description, - AggregationType aggregation_type, - std::shared_ptr aggregation_config, - std::unique_ptr attributes_processor) +std::unique_ptr ViewFactory::Create( + const std::string &name, + const std::string &description, + AggregationType aggregation_type, + const std::shared_ptr &aggregation_config, + std::unique_ptr attributes_processor) { - std::unique_ptr view(new View(name, description, aggregation_type, - std::move(aggregation_config), + std::unique_ptr view(new View(name, description, aggregation_type, aggregation_config, std::move(attributes_processor))); return view; } diff --git a/test_common/include/opentelemetry/test_common/ext/http/client/nosend/http_client_nosend.h b/test_common/include/opentelemetry/test_common/ext/http/client/nosend/http_client_nosend.h index 6a30e4fd26..646ddee1e2 100644 --- a/test_common/include/opentelemetry/test_common/ext/http/client/nosend/http_client_nosend.h +++ b/test_common/include/opentelemetry/test_common/ext/http/client/nosend/http_client_nosend.h @@ -134,9 +134,9 @@ class Session : public opentelemetry::ext::http::client::Session { public: Session(HttpClient &http_client, - std::string scheme = "http", - const std::string &host = "", - uint16_t port = 80) + const std::string &scheme = "http", + const std::string &host = "", + uint16_t port = 80) : http_client_(http_client), is_session_active_(false) { host_ = scheme + "://" + host + ":" + std::to_string(port) + "/";