From 0bdcb408bfb5ac79e8b3fcd6860bc6c6bd6bec77 Mon Sep 17 00:00:00 2001 From: Utkarsh Umesan Pillai Date: Tue, 28 May 2024 20:06:37 -0700 Subject: [PATCH 1/2] Simplify tests --- stress/src/metrics_counter.rs | 4 ++-- stress/src/metrics_histogram.rs | 4 ++-- stress/src/metrics_overflow.rs | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/stress/src/metrics_counter.rs b/stress/src/metrics_counter.rs index 2cc3dbf7cd..a9a8d573bb 100644 --- a/stress/src/metrics_counter.rs +++ b/stress/src/metrics_counter.rs @@ -16,7 +16,7 @@ use rand::{ rngs::{self}, Rng, SeedableRng, }; -use std::{borrow::Cow, cell::RefCell}; +use std::cell::RefCell; mod throughput; @@ -29,7 +29,7 @@ lazy_static! { "value10" ]; static ref COUNTER: Counter = PROVIDER - .meter(<&str as Into>>::into("test")) + .meter("test") .u64_counter("hello") .init(); } diff --git a/stress/src/metrics_histogram.rs b/stress/src/metrics_histogram.rs index 8b7690b5ae..d6dc1c2189 100644 --- a/stress/src/metrics_histogram.rs +++ b/stress/src/metrics_histogram.rs @@ -16,7 +16,7 @@ use rand::{ rngs::{self}, Rng, SeedableRng, }; -use std::{borrow::Cow, cell::RefCell}; +use std::cell::RefCell; mod throughput; @@ -29,7 +29,7 @@ lazy_static! { "value10" ]; static ref HISTOGRAM: Histogram = PROVIDER - .meter(<&str as Into>>::into("test")) + .meter("test") .u64_histogram("hello") .init(); } diff --git a/stress/src/metrics_overflow.rs b/stress/src/metrics_overflow.rs index 0e27c96b24..b7f2f85676 100644 --- a/stress/src/metrics_overflow.rs +++ b/stress/src/metrics_overflow.rs @@ -16,7 +16,7 @@ use rand::{ rngs::{self}, Rng, SeedableRng, }; -use std::{borrow::Cow, cell::RefCell}; +use std::cell::RefCell; mod throughput; @@ -25,7 +25,7 @@ lazy_static! { .with_reader(ManualReader::builder().build()) .build(); static ref COUNTER: Counter = PROVIDER - .meter(<&str as Into>>::into("test")) + .meter("test") .u64_counter("hello") .init(); } From bc17a7f86b23223bc6bf2486ea99d475c2a9a928 Mon Sep 17 00:00:00 2001 From: Utkarsh Umesan Pillai Date: Tue, 28 May 2024 20:13:58 -0700 Subject: [PATCH 2/2] Fix lint --- stress/src/metrics_counter.rs | 5 +---- stress/src/metrics_histogram.rs | 5 +---- stress/src/metrics_overflow.rs | 5 +---- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/stress/src/metrics_counter.rs b/stress/src/metrics_counter.rs index a9a8d573bb..7a38bb2938 100644 --- a/stress/src/metrics_counter.rs +++ b/stress/src/metrics_counter.rs @@ -28,10 +28,7 @@ lazy_static! { "value1", "value2", "value3", "value4", "value5", "value6", "value7", "value8", "value9", "value10" ]; - static ref COUNTER: Counter = PROVIDER - .meter("test") - .u64_counter("hello") - .init(); + static ref COUNTER: Counter = PROVIDER.meter("test").u64_counter("hello").init(); } thread_local! { diff --git a/stress/src/metrics_histogram.rs b/stress/src/metrics_histogram.rs index d6dc1c2189..321deb57ec 100644 --- a/stress/src/metrics_histogram.rs +++ b/stress/src/metrics_histogram.rs @@ -28,10 +28,7 @@ lazy_static! { "value1", "value2", "value3", "value4", "value5", "value6", "value7", "value8", "value9", "value10" ]; - static ref HISTOGRAM: Histogram = PROVIDER - .meter("test") - .u64_histogram("hello") - .init(); + static ref HISTOGRAM: Histogram = PROVIDER.meter("test").u64_histogram("hello").init(); } thread_local! { diff --git a/stress/src/metrics_overflow.rs b/stress/src/metrics_overflow.rs index b7f2f85676..dfb13170a8 100644 --- a/stress/src/metrics_overflow.rs +++ b/stress/src/metrics_overflow.rs @@ -24,10 +24,7 @@ lazy_static! { static ref PROVIDER: SdkMeterProvider = SdkMeterProvider::builder() .with_reader(ManualReader::builder().build()) .build(); - static ref COUNTER: Counter = PROVIDER - .meter("test") - .u64_counter("hello") - .init(); + static ref COUNTER: Counter = PROVIDER.meter("test").u64_counter("hello").init(); } thread_local! {