@@ -4,7 +4,7 @@ use opentelemetry_sdk::{
44 metrics:: {
55 data:: { self , Gauge , Histogram , Sum } ,
66 reader:: MetricReader ,
7- InstrumentKind , ManualReader , MeterProviderBuilder , SdkMeterProvider ,
7+ InstrumentKind , ManualReader , MeterProviderBuilder ,
88 } ,
99} ;
1010
@@ -27,9 +27,8 @@ async fn u64_counter_is_exported() {
2727
2828 tracing:: subscriber:: with_default ( subscriber, || {
2929 tracing:: info!( monotonic_counter. hello_world = 1_u64 ) ;
30+ exporter. export ( ) . unwrap ( ) ;
3031 } ) ;
31-
32- exporter. export ( ) . unwrap ( ) ;
3332}
3433
3534#[ tokio:: test]
@@ -43,9 +42,8 @@ async fn u64_counter_is_exported_i64_at_instrumentation_point() {
4342
4443 tracing:: subscriber:: with_default ( subscriber, || {
4544 tracing:: info!( monotonic_counter. hello_world2 = 1_i64 ) ;
45+ exporter. export ( ) . unwrap ( ) ;
4646 } ) ;
47-
48- exporter. export ( ) . unwrap ( ) ;
4947}
5048
5149#[ tokio:: test]
@@ -59,9 +57,8 @@ async fn f64_counter_is_exported() {
5957
6058 tracing:: subscriber:: with_default ( subscriber, || {
6159 tracing:: info!( monotonic_counter. float_hello_world = 1.000000123_f64 ) ;
60+ exporter. export ( ) . unwrap ( ) ;
6261 } ) ;
63-
64- exporter. export ( ) . unwrap ( ) ;
6562}
6663
6764#[ tokio:: test]
@@ -75,9 +72,8 @@ async fn i64_up_down_counter_is_exported() {
7572
7673 tracing:: subscriber:: with_default ( subscriber, || {
7774 tracing:: info!( counter. pebcak = -5_i64 ) ;
75+ exporter. export ( ) . unwrap ( ) ;
7876 } ) ;
79-
80- exporter. export ( ) . unwrap ( ) ;
8177}
8278
8379#[ tokio:: test]
@@ -91,9 +87,8 @@ async fn i64_up_down_counter_is_exported_u64_at_instrumentation_point() {
9187
9288 tracing:: subscriber:: with_default ( subscriber, || {
9389 tracing:: info!( counter. pebcak2 = 5_u64 ) ;
90+ exporter. export ( ) . unwrap ( ) ;
9491 } ) ;
95-
96- exporter. export ( ) . unwrap ( ) ;
9792}
9893
9994#[ tokio:: test]
@@ -107,9 +102,8 @@ async fn f64_up_down_counter_is_exported() {
107102
108103 tracing:: subscriber:: with_default ( subscriber, || {
109104 tracing:: info!( counter. pebcak_blah = 99.123_f64 ) ;
105+ exporter. export ( ) . unwrap ( ) ;
110106 } ) ;
111-
112- exporter. export ( ) . unwrap ( ) ;
113107}
114108
115109#[ tokio:: test]
@@ -120,9 +114,8 @@ async fn u64_gauge_is_exported() {
120114 tracing:: subscriber:: with_default ( subscriber, || {
121115 tracing:: info!( gauge. gygygy = 1_u64 ) ;
122116 tracing:: info!( gauge. gygygy = 2_u64 ) ;
117+ exporter. export ( ) . unwrap ( ) ;
123118 } ) ;
124-
125- exporter. export ( ) . unwrap ( ) ;
126119}
127120
128121#[ tokio:: test]
@@ -133,9 +126,8 @@ async fn f64_gauge_is_exported() {
133126 tracing:: subscriber:: with_default ( subscriber, || {
134127 tracing:: info!( gauge. huitt = 1_f64 ) ;
135128 tracing:: info!( gauge. huitt = 2_f64 ) ;
129+ exporter. export ( ) . unwrap ( ) ;
136130 } ) ;
137-
138- exporter. export ( ) . unwrap ( ) ;
139131}
140132
141133#[ tokio:: test]
@@ -146,9 +138,8 @@ async fn i64_gauge_is_exported() {
146138 tracing:: subscriber:: with_default ( subscriber, || {
147139 tracing:: info!( gauge. samsagaz = 1_i64 ) ;
148140 tracing:: info!( gauge. samsagaz = 2_i64 ) ;
141+ exporter. export ( ) . unwrap ( ) ;
149142 } ) ;
150-
151- exporter. export ( ) . unwrap ( ) ;
152143}
153144
154145#[ tokio:: test]
@@ -162,9 +153,8 @@ async fn u64_histogram_is_exported() {
162153
163154 tracing:: subscriber:: with_default ( subscriber, || {
164155 tracing:: info!( histogram. abcdefg = 9_u64 ) ;
156+ exporter. export ( ) . unwrap ( ) ;
165157 } ) ;
166-
167- exporter. export ( ) . unwrap ( ) ;
168158}
169159
170160#[ tokio:: test]
@@ -178,9 +168,8 @@ async fn f64_histogram_is_exported() {
178168
179169 tracing:: subscriber:: with_default ( subscriber, || {
180170 tracing:: info!( histogram. abcdefg_racecar = 777.0012_f64 ) ;
171+ exporter. export ( ) . unwrap ( ) ;
181172 } ) ;
182-
183- exporter. export ( ) . unwrap ( ) ;
184173}
185174
186175#[ tokio:: test]
@@ -207,9 +196,8 @@ async fn u64_counter_with_attributes_is_exported() {
207196 str_key_1 = "foo" ,
208197 bool_key_1 = true ,
209198 ) ;
199+ exporter. export ( ) . unwrap ( ) ;
210200 } ) ;
211-
212- exporter. export ( ) . unwrap ( ) ;
213201}
214202
215203#[ tokio:: test]
@@ -236,9 +224,8 @@ async fn f64_counter_with_attributes_is_exported() {
236224 str_key_1 = "foo" ,
237225 bool_key_1 = true ,
238226 ) ;
227+ exporter. export ( ) . unwrap ( ) ;
239228 } ) ;
240-
241- exporter. export ( ) . unwrap ( ) ;
242229}
243230
244231#[ tokio:: test]
@@ -265,9 +252,8 @@ async fn i64_up_down_counter_with_attributes_is_exported() {
265252 str_key_1 = "foo" ,
266253 bool_key_1 = true ,
267254 ) ;
255+ exporter. export ( ) . unwrap ( ) ;
268256 } ) ;
269-
270- exporter. export ( ) . unwrap ( ) ;
271257}
272258
273259#[ tokio:: test]
@@ -294,9 +280,8 @@ async fn f64_up_down_counter_with_attributes_is_exported() {
294280 str_key_1 = "foo" ,
295281 bool_key_1 = true ,
296282 ) ;
283+ exporter. export ( ) . unwrap ( ) ;
297284 } ) ;
298-
299- exporter. export ( ) . unwrap ( ) ;
300285}
301286
302287#[ tokio:: test]
@@ -323,9 +308,8 @@ async fn f64_gauge_with_attributes_is_exported() {
323308 str_key_1 = "foo" ,
324309 bool_key_1 = true ,
325310 ) ;
311+ exporter. export ( ) . unwrap ( ) ;
326312 } ) ;
327-
328- exporter. export ( ) . unwrap ( ) ;
329313}
330314
331315#[ tokio:: test]
@@ -352,9 +336,8 @@ async fn u64_gauge_with_attributes_is_exported() {
352336 str_key_1 = "foo" ,
353337 bool_key_1 = true ,
354338 ) ;
339+ exporter. export ( ) . unwrap ( ) ;
355340 } ) ;
356-
357- exporter. export ( ) . unwrap ( ) ;
358341}
359342
360343#[ tokio:: test]
@@ -381,9 +364,8 @@ async fn i64_gauge_with_attributes_is_exported() {
381364 str_key_1 = "foo" ,
382365 bool_key_1 = true ,
383366 ) ;
367+ exporter. export ( ) . unwrap ( ) ;
384368 } ) ;
385-
386- exporter. export ( ) . unwrap ( ) ;
387369}
388370
389371#[ tokio:: test]
@@ -410,9 +392,8 @@ async fn u64_histogram_with_attributes_is_exported() {
410392 str_key_1 = "foo" ,
411393 bool_key_1 = true ,
412394 ) ;
395+ exporter. export ( ) . unwrap ( ) ;
413396 } ) ;
414-
415- exporter. export ( ) . unwrap ( ) ;
416397}
417398
418399#[ tokio:: test]
@@ -439,9 +420,8 @@ async fn f64_histogram_with_attributes_is_exported() {
439420 str_key_1 = "foo" ,
440421 bool_key_1 = true ,
441422 ) ;
423+ exporter. export ( ) . unwrap ( ) ;
442424 } ) ;
443-
444- exporter. export ( ) . unwrap ( ) ;
445425}
446426
447427#[ tokio:: test]
@@ -468,9 +448,8 @@ async fn display_attribute_is_exported() {
468448 monotonic_counter. hello_world = 1_u64 ,
469449 display_key_1 = %display_attribute,
470450 ) ;
451+ exporter. export ( ) . unwrap ( ) ;
471452 } ) ;
472-
473- exporter. export ( ) . unwrap ( ) ;
474453}
475454
476455#[ tokio:: test]
@@ -497,9 +476,8 @@ async fn debug_attribute_is_exported() {
497476 monotonic_counter. hello_world = 1_u64 ,
498477 debug_key_1 = ?debug_attribute,
499478 ) ;
479+ exporter. export ( ) . unwrap ( ) ;
500480 } ) ;
501-
502- exporter. export ( ) . unwrap ( ) ;
503481}
504482
505483fn init_subscriber < T > (
@@ -522,7 +500,6 @@ fn init_subscriber<T>(
522500 expected_value,
523501 expected_attributes,
524502 reader,
525- _meter_provider : provider. clone ( ) ,
526503 } ;
527504
528505 (
@@ -568,7 +545,6 @@ struct TestExporter<T> {
568545 expected_value : T ,
569546 expected_attributes : Option < Vec < KeyValue > > ,
570547 reader : TestReader ,
571- _meter_provider : SdkMeterProvider ,
572548}
573549
574550trait AsAny {
0 commit comments