File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
mountpoint-s3-client/examples
mountpoint-s3-fs/examples Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,8 @@ use tracing_subscriber::EnvFilter;
1818use tracing_subscriber:: fmt:: Subscriber ;
1919use tracing_subscriber:: util:: SubscriberInitExt ;
2020
21+ const SECONDS_PER_DAY : u64 = 86400 ;
22+
2123/// Like `tracing_subscriber::fmt::init` but sends logs to stderr
2224fn init_tracing_subscriber ( ) {
2325 RustLogAdapter :: try_init ( ) . expect ( "unable to install CRT log adapter" ) ;
@@ -44,7 +46,7 @@ fn run_benchmark(
4446 let total_start = Instant :: now ( ) ;
4547 let mut iter_results = Vec :: new ( ) ;
4648 let mut iteration = 0 ;
47- let duration = max_duration. unwrap_or ( Duration :: from_secs ( 86400 ) ) ;
49+ let duration = max_duration. unwrap_or ( Duration :: from_secs ( SECONDS_PER_DAY ) ) ;
4850 let timeout: Instant = total_start. checked_add ( duration) . expect ( "Duration overflow error" ) ;
4951
5052 while iteration < num_iterations && Instant :: now ( ) < timeout {
Original file line number Diff line number Diff line change @@ -21,6 +21,8 @@ use tracing_subscriber::EnvFilter;
2121use tracing_subscriber:: fmt:: Subscriber ;
2222use tracing_subscriber:: util:: SubscriberInitExt ;
2323
24+ const SECONDS_PER_DAY : u64 = 86400 ;
25+
2426/// Like `tracing_subscriber::fmt::init` but sends logs to stderr
2527fn init_tracing_subscriber ( ) {
2628 RustLogAdapter :: try_init ( ) . expect ( "should succeed as first and only adapter init call" ) ;
@@ -159,7 +161,7 @@ fn main() -> anyhow::Result<()> {
159161 let mut iteration = 0 ;
160162 let mut total_bytes = 0 ;
161163 let mut iter_results = Vec :: new ( ) ;
162- let max_duration = args. max_duration . unwrap_or ( Duration :: from_secs ( 86400 ) ) ;
164+ let max_duration = args. max_duration . unwrap_or ( Duration :: from_secs ( SECONDS_PER_DAY ) ) ;
163165 let timeout: Instant = total_start. checked_add ( max_duration) . expect ( "Duration overflow error" ) ;
164166 while iteration < args. iterations && Instant :: now ( ) < timeout {
165167 let received_bytes = Arc :: new ( AtomicU64 :: new ( 0 ) ) ;
You can’t perform that action at this time.
0 commit comments