Skip to content

Commit 771c191

Browse files
authored
Merge branch 'main' into update-log-bench-stats
2 parents 3ae2283 + 916a117 commit 771c191

File tree

3 files changed

+3
-68
lines changed

3 files changed

+3
-68
lines changed

opentelemetry-sdk/Cargo.toml

-4
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,6 @@ harness = false
7272
name = "metrics_histogram"
7373
harness = false
7474

75-
[[bench]]
76-
name = "attribute_set"
77-
harness = false
78-
7975
[[bench]]
8076
name = "trace"
8177
harness = false

opentelemetry-sdk/benches/attribute_set.rs

-40
This file was deleted.

opentelemetry-sdk/src/metrics/mod.rs

+3-24
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ use opentelemetry::{Key, KeyValue, Value};
7272
/// This must implement [Hash], [PartialEq], and [Eq] so it may be used as
7373
/// HashMap keys and other de-duplication methods.
7474
#[derive(Clone, Default, Debug, PartialEq, Eq)]
75-
pub struct AttributeSet(Vec<KeyValue>, u64);
75+
pub(crate) struct AttributeSet(Vec<KeyValue>, u64);
7676

7777
impl From<&[KeyValue]> for AttributeSet {
7878
fn from(values: &[KeyValue]) -> Self {
@@ -109,34 +109,13 @@ impl AttributeSet {
109109
AttributeSet(values, hash)
110110
}
111111

112-
/// Returns `true` if the set contains no elements.
113-
pub fn is_empty(&self) -> bool {
114-
self.0.is_empty()
115-
}
116-
117-
/// Retains only the attributes specified by the predicate.
118-
pub fn retain<F>(&mut self, f: F)
119-
where
120-
F: Fn(&KeyValue) -> bool,
121-
{
122-
self.0.retain(|kv| f(kv));
123-
124-
// Recalculate the hash as elements are changed.
125-
self.1 = calculate_hash(&self.0);
126-
}
127-
128112
/// Iterate over key value pairs in the set
129-
pub fn iter(&self) -> impl Iterator<Item = (&Key, &Value)> {
113+
pub(crate) fn iter(&self) -> impl Iterator<Item = (&Key, &Value)> {
130114
self.0.iter().map(|kv| (&kv.key, &kv.value))
131115
}
132116

133-
/// Returns a slice of the key value pairs in the set
134-
pub fn as_slice(&self) -> &[KeyValue] {
135-
&self.0
136-
}
137-
138117
/// Returns the underlying Vec of KeyValue pairs
139-
pub fn into_vec(self) -> Vec<KeyValue> {
118+
pub(crate) fn into_vec(self) -> Vec<KeyValue> {
140119
self.0
141120
}
142121
}

0 commit comments

Comments
 (0)