|
10 | 10 | #include <unordered_map> |
11 | 11 | #include <utility> |
12 | 12 |
|
13 | | -#include "opentelemetry/common/key_value_iterable.h" |
14 | 13 | #include "opentelemetry/nostd/function_ref.h" |
15 | 14 | #include "opentelemetry/sdk/common/attribute_utils.h" |
16 | 15 | #include "opentelemetry/sdk/common/attributemap_hash.h" |
17 | 16 | #include "opentelemetry/sdk/metrics/aggregation/aggregation.h" |
18 | 17 | #include "opentelemetry/sdk/metrics/state/filtered_ordered_attribute_map.h" |
19 | | -#include "opentelemetry/sdk/metrics/view/attributes_processor.h" |
20 | 18 | #include "opentelemetry/version.h" |
21 | 19 |
|
22 | 20 | OPENTELEMETRY_BEGIN_NAMESPACE |
@@ -80,30 +78,6 @@ class AttributesHashMapWithCustomHash |
80 | 78 | * If not present, it uses the provided callback to generate |
81 | 79 | * value and store in the hash |
82 | 80 | */ |
83 | | - Aggregation *GetOrSetDefault( |
84 | | - const opentelemetry::common::KeyValueIterable &attributes, |
85 | | - const AttributesProcessor *attributes_processor, |
86 | | - nostd::function_ref<std::unique_ptr<Aggregation>()> aggregation_callback) |
87 | | - { |
88 | | - // TODO: avoid constructing MetricAttributes from KeyValueIterable for |
89 | | - // hash_map_.find which is a heavy operation |
90 | | - MetricAttributes attr{attributes, attributes_processor}; |
91 | | - |
92 | | - auto it = hash_map_.find(attr); |
93 | | - if (it != hash_map_.end()) |
94 | | - { |
95 | | - return it->second.get(); |
96 | | - } |
97 | | - |
98 | | - if (IsOverflowAttributes(attr)) |
99 | | - { |
100 | | - return GetOrSetOveflowAttributes(aggregation_callback); |
101 | | - } |
102 | | - |
103 | | - auto result = hash_map_.emplace(std::move(attr), aggregation_callback()); |
104 | | - return result.first->second.get(); |
105 | | - } |
106 | | - |
107 | 81 | Aggregation *GetOrSetDefault( |
108 | 82 | const MetricAttributes &attributes, |
109 | 83 | nostd::function_ref<std::unique_ptr<Aggregation>()> aggregation_callback) |
@@ -144,13 +118,6 @@ class AttributesHashMapWithCustomHash |
144 | 118 | /** |
145 | 119 | * Set the value for given key, overwriting the value if already present |
146 | 120 | */ |
147 | | - void Set(const opentelemetry::common::KeyValueIterable &attributes, |
148 | | - const AttributesProcessor *attributes_processor, |
149 | | - std::unique_ptr<Aggregation> aggr) |
150 | | - { |
151 | | - Set(MetricAttributes{attributes, attributes_processor}, std::move(aggr)); |
152 | | - } |
153 | | - |
154 | 121 | void Set(const MetricAttributes &attributes, std::unique_ptr<Aggregation> aggr) |
155 | 122 | { |
156 | 123 | auto it = hash_map_.find(attributes); |
|
0 commit comments