File tree Expand file tree Collapse file tree 3 files changed +7
-2
lines changed Expand file tree Collapse file tree 3 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,7 @@ rt-tokio = ["tokio", "tokio-stream"]
5353rt-tokio-current-thread = [" tokio" , " tokio-stream" ]
5454rt-async-std = [" async-std" ]
5555internal-logs = [" tracing" ]
56+ experimental_metrics_periodic_reader_no_runtime = [" metrics" ]
5657
5758[[bench ]]
5859name = " context"
Original file line number Diff line number Diff line change @@ -50,6 +50,7 @@ pub(crate) mod meter;
5050mod meter_provider;
5151pub ( crate ) mod noop;
5252pub ( crate ) mod periodic_reader;
53+ #[ cfg( feature = "experimental_metrics_periodic_reader_no_runtime" ) ]
5354pub ( crate ) mod periodic_reader_with_own_thread;
5455pub ( crate ) mod pipeline;
5556pub mod reader;
@@ -61,6 +62,7 @@ pub use instrument::*;
6162pub use manual_reader:: * ;
6263pub use meter_provider:: * ;
6364pub use periodic_reader:: * ;
65+ #[ cfg( feature = "experimental_metrics_periodic_reader_no_runtime" ) ]
6466pub use periodic_reader_with_own_thread:: * ;
6567pub use pipeline:: Pipeline ;
6668pub use view:: * ;
Original file line number Diff line number Diff line change @@ -355,7 +355,8 @@ impl PeriodicReaderInner {
355355 // take arbitrary time.
356356 //
357357 // Relying on futures executor to execute async call.
358- // TODO: Add timeout and pass it to exporter.
358+ // TODO: Add timeout and pass it to exporter or consider alternative
359+ // design to enforce timeout here.
359360 let exporter_result = futures_executor:: block_on ( self . exporter . export ( & mut rm) ) ;
360361 #[ allow( clippy:: question_mark) ]
361362 if let Err ( e) = exporter_result {
@@ -392,6 +393,7 @@ impl PeriodicReaderInner {
392393 }
393394
394395 if let Ok ( response) = response_rx. recv ( ) {
396+ // TODO: call exporter's force_flush method.
395397 if response {
396398 Ok ( ( ) )
397399 } else {
@@ -502,7 +504,7 @@ mod tests {
502504 } ;
503505
504506 // use below command to run all tests
505- // cargo test metrics::periodic_reader_with_own_thread::tests --features=testing -- --nocapture
507+ // cargo test metrics::periodic_reader_with_own_thread::tests --features=testing,experimental_metrics_periodic_reader_no_runtime -- --nocapture
506508
507509 #[ derive( Debug , Clone ) ]
508510 struct MetricExporterThatFailsOnlyOnFirst {
You can’t perform that action at this time.
0 commit comments