Skip to content

Commit

Permalink
Merge branch 'main' into FixGoogleTest
Browse files Browse the repository at this point in the history
  • Loading branch information
lalitb committed Apr 15, 2022
2 parents 8d3db21 + e3304d7 commit ad665d2
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ class AttributesProcessor
// @returns The processed attributes
virtual MetricAttributes process(
const opentelemetry::common::KeyValueIterable &attributes) const noexcept = 0;

virtual ~AttributesProcessor() = default;
};

/**
Expand Down
2 changes: 1 addition & 1 deletion sdk/src/metrics/meter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ std::unique_ptr<WritableMetricStorage> 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 **/
Expand Down
5 changes: 2 additions & 3 deletions sdk/test/metrics/attributes_hashmap_benchmark.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,12 @@ void BM_AttributseHashMap(benchmark::State &state)

std::function<std::unique_ptr<Aggregation>()> create_default_aggregation =
[]() -> std::unique_ptr<Aggregation> {
auto agg = std::unique_ptr<Aggregation>(new DropAggregation);
return std::move(agg);
return std::unique_ptr<Aggregation>(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);
Expand Down
3 changes: 1 addition & 2 deletions sdk/test/metrics/attributes_hashmap_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ TEST(AttributesHashMap, BasicTests)
// GetOrSetDefault
std::function<std::unique_ptr<Aggregation>()> create_default_aggregation =
[]() -> std::unique_ptr<Aggregation> {
auto agg = std::unique_ptr<Aggregation>(new DropAggregation);
return std::move(agg);
return std::unique_ptr<Aggregation>(new DropAggregation);
};
MetricAttributes m4 = {{"k1", "v1"}, {"k2", "v2"}, {"k3", "v3"}};
EXPECT_NO_THROW(hash_map.GetOrSetDefault(m4, create_default_aggregation)->Aggregate(1l));
Expand Down

0 comments on commit ad665d2

Please sign in to comment.