From 01eac4ca9c8d716dd99703b9acea21c0b3e0abb6 Mon Sep 17 00:00:00 2001 From: Lalit Kumar Bhasin Date: Thu, 16 Feb 2023 18:32:53 -0800 Subject: [PATCH] fix variable names (#1987) --- sdk/test/metrics/sync_instruments_test.cc | 44 +++++++++++------------ 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/sdk/test/metrics/sync_instruments_test.cc b/sdk/test/metrics/sync_instruments_test.cc index 0747115bab..a1ff2325e2 100644 --- a/sdk/test/metrics/sync_instruments_test.cc +++ b/sdk/test/metrics/sync_instruments_test.cc @@ -98,15 +98,15 @@ TEST(SyncInstruments, LongHistogram) InstrumentDescriptor instrument_descriptor = { "long_histogram", "description", "1", InstrumentType::kHistogram, InstrumentValueType::kLong}; std::unique_ptr metric_storage(new SyncMultiMetricStorage()); - LongHistogram counter(instrument_descriptor, std::move(metric_storage)); - counter.Record(10, opentelemetry::context::Context{}); - counter.Record(-10, opentelemetry::context::Context{}); // This is ignored - - counter.Record(10, - opentelemetry::common::KeyValueIterableView({{"abc", "123"}, {"xyz", "456"}}), - opentelemetry::context::Context{}); - counter.Record(10, opentelemetry::common::KeyValueIterableView({}), - opentelemetry::context::Context{}); + LongHistogram histogram(instrument_descriptor, std::move(metric_storage)); + histogram.Record(10, opentelemetry::context::Context{}); + histogram.Record(-10, opentelemetry::context::Context{}); // This is ignored + + histogram.Record(10, + opentelemetry::common::KeyValueIterableView({{"abc", "123"}, {"xyz", "456"}}), + opentelemetry::context::Context{}); + histogram.Record(10, opentelemetry::common::KeyValueIterableView({}), + opentelemetry::context::Context{}); } TEST(SyncInstruments, DoubleHistogram) @@ -115,17 +115,17 @@ TEST(SyncInstruments, DoubleHistogram) InstrumentType::kHistogram, InstrumentValueType::kDouble}; std::unique_ptr metric_storage(new SyncMultiMetricStorage()); - DoubleHistogram counter(instrument_descriptor, std::move(metric_storage)); - counter.Record(10.10, opentelemetry::context::Context{}); - counter.Record(-10.10, opentelemetry::context::Context{}); // This is ignored. - counter.Record(std::numeric_limits::quiet_NaN(), - opentelemetry::context::Context{}); // This is ignored too - counter.Record(std::numeric_limits::infinity(), - opentelemetry::context::Context{}); // This is ignored too - - counter.Record(10.10, - opentelemetry::common::KeyValueIterableView({{"abc", "123"}, {"xyz", "456"}}), - opentelemetry::context::Context{}); - counter.Record(10.10, opentelemetry::common::KeyValueIterableView({}), - opentelemetry::context::Context{}); + DoubleHistogram histogram(instrument_descriptor, std::move(metric_storage)); + histogram.Record(10.10, opentelemetry::context::Context{}); + histogram.Record(-10.10, opentelemetry::context::Context{}); // This is ignored. + histogram.Record(std::numeric_limits::quiet_NaN(), + opentelemetry::context::Context{}); // This is ignored too + histogram.Record(std::numeric_limits::infinity(), + opentelemetry::context::Context{}); // This is ignored too + + histogram.Record(10.10, + opentelemetry::common::KeyValueIterableView({{"abc", "123"}, {"xyz", "456"}}), + opentelemetry::context::Context{}); + histogram.Record(10.10, opentelemetry::common::KeyValueIterableView({}), + opentelemetry::context::Context{}); }