Skip to content

Commit

Permalink
Address PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
utpilla committed Jan 8, 2025
1 parent e6ca3a7 commit 5f0e3d4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 24 deletions.
17 changes: 5 additions & 12 deletions opentelemetry-sdk/benches/metrics_counter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,11 @@ fn criterion_benchmark(c: &mut Criterion) {
counter_add_sorted(c);
counter_add_unsorted(c);

let attribute_values = [
"value1".to_owned(),
"value2".to_owned(),
"value3".to_owned(),
"value4".to_owned(),
"value5".to_owned(),
"value6".to_owned(),
"value7".to_owned(),
"value8".to_owned(),
"value9".to_owned(),
"value10".to_owned(),
];
let attribute_values: [String; 10] = (1..=10)
.map(|i| format!("value{}", i))
.collect::<Vec<String>>()
.try_into()
.expect("Expected a Vec of length 10");

counter_add_sorted_with_non_static_values(c, attribute_values);

Expand Down
18 changes: 6 additions & 12 deletions opentelemetry-sdk/benches/metrics_histogram.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,12 @@ fn create_histogram(name: &'static str) -> Histogram<u64> {
fn criterion_benchmark(c: &mut Criterion) {
histogram_record(c);

let attribute_values = [
"value1".to_owned(),
"value2".to_owned(),
"value3".to_owned(),
"value4".to_owned(),
"value5".to_owned(),
"value6".to_owned(),
"value7".to_owned(),
"value8".to_owned(),
"value9".to_owned(),
"value10".to_owned(),
];
let attribute_values: [String; 10] = (1..=10)
.map(|i| format!("value{}", i))
.collect::<Vec<String>>()
.try_into()
.expect("Expected a Vec of length 10");

histogram_record_with_non_static_values(c, attribute_values);
}

Expand Down

0 comments on commit 5f0e3d4

Please sign in to comment.