Skip to content

Commit 881daad

Browse files
authored
[SDK] Fix typo in hashmap method GetEnteries (open-telemetry#3680)
1 parent 90db398 commit 881daad

File tree

4 files changed

+11
-8
lines changed

4 files changed

+11
-8
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ Increment the:
1818
* [TEST] Remove workaround for metrics cardinality limit test
1919
[#3663](https://github.com/open-telemetry/opentelemetry-cpp/pull/3663)
2020

21+
* [SDK] Fix typo in hashmap method GetEnteries
22+
[#3680](https://github.com/open-telemetry/opentelemetry-cpp/pull/3680)
23+
2124
## [1.23 2025-09-25]
2225

2326
* [CodeHealth] Fix clang-tidy warnings part 6

sdk/include/opentelemetry/sdk/metrics/state/attributes_hashmap.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ class AttributesHashMapWithCustomHash
188188
/**
189189
* Iterate the hash to yield key and value stored in hash.
190190
*/
191-
bool GetAllEnteries(
191+
bool GetAllEntries(
192192
nostd::function_ref<bool(const MetricAttributes &, Aggregation &)> callback) const
193193
{
194194
for (auto &kv : hash_map_)

sdk/src/metrics/state/temporal_metric_storage.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ bool TemporalMetricStorage::buildMetrics(CollectorHandle *collector,
6767
metric_data.end_ts = collection_ts;
6868

6969
// Direct conversion of delta metrics to point data
70-
delta_metrics->GetAllEnteries(
70+
delta_metrics->GetAllEntries(
7171
[&metric_data](const MetricAttributes &attributes, Aggregation &aggregation) {
7272
PointDataAttributes point_data_attr;
7373
point_data_attr.point_data = aggregation.ToPoint();
@@ -102,7 +102,7 @@ bool TemporalMetricStorage::buildMetrics(CollectorHandle *collector,
102102
: kAggregationCardinalityLimit));
103103
for (auto &agg_hashmap : unreported_list)
104104
{
105-
agg_hashmap->GetAllEnteries(
105+
agg_hashmap->GetAllEntries(
106106
[&merged_metrics, this](const MetricAttributes &attributes, Aggregation &aggregation) {
107107
auto agg = merged_metrics->Get(attributes);
108108
if (agg)
@@ -135,7 +135,7 @@ bool TemporalMetricStorage::buildMetrics(CollectorHandle *collector,
135135
if (aggregation_temporarily == AggregationTemporality::kCumulative)
136136
{
137137
// merge current delta to previous cumulative
138-
last_aggr_hashmap->GetAllEnteries(
138+
last_aggr_hashmap->GetAllEntries(
139139
[&merged_metrics, this](const MetricAttributes &attributes, Aggregation &aggregation) {
140140
auto agg = merged_metrics->Get(attributes);
141141
if (agg)
@@ -172,7 +172,7 @@ bool TemporalMetricStorage::buildMetrics(CollectorHandle *collector,
172172
metric_data.aggregation_temporality = aggregation_temporarily;
173173
metric_data.start_ts = last_collection_ts;
174174
metric_data.end_ts = collection_ts;
175-
result_to_export->GetAllEnteries(
175+
result_to_export->GetAllEntries(
176176
[&metric_data](const MetricAttributes &attributes, Aggregation &aggregation) {
177177
PointDataAttributes point_data_attr;
178178
point_data_attr.point_data = aggregation.ToPoint();

sdk/test/metrics/attributes_hashmap_test.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,9 @@ TEST(AttributesHashMap, BasicTests)
7171
MetricAttributes m6 = {{"k1", "v2"}, {"k2", "v1"}};
7272
EXPECT_EQ(hash_map.Has(m6), false);
7373

74-
// GetAllEnteries
74+
// GetAllEntries
7575
size_t count = 0;
76-
hash_map.GetAllEnteries(
76+
hash_map.GetAllEntries(
7777
[&count](const MetricAttributes & /* attributes */, Aggregation & /* aggregation */) {
7878
count++;
7979
return true;
@@ -210,7 +210,7 @@ TEST(AttributesHashMap, OverflowCardinalityLimitBehavior)
210210

211211
// Copy the hash map to a new map in non-determistic order and verify all entries are present
212212
AttributesHashMapWithCustomHash<> map_copy(limit);
213-
map.GetAllEnteries([&map_copy](const MetricAttributes &attributes, Aggregation &) {
213+
map.GetAllEntries([&map_copy](const MetricAttributes &attributes, Aggregation &) {
214214
map_copy.Set(attributes, std::unique_ptr<Aggregation>(new DropAggregation()));
215215
return true;
216216
});

0 commit comments

Comments
 (0)