diff options
author | Florian Klink <flokli@flokli.de> | 2024-06-16T16·22+0300 |
---|---|---|
committer | flokli <flokli@flokli.de> | 2024-06-17T12·57+0000 |
commit | 28b692fd507b5a32add96e3694bd1f2959bd9608 (patch) | |
tree | 945ed9c6feafb45a7fc1b366b7d5254064213134 /tvix/store/src | |
parent | cfab953094c6da5a919ea968f2bd7753035005c7 (diff) |
feat(tvix/tvix-store): improve progress bars r/8289
Don't show an empty spinner for daemon commands. Move the bar to the right, so the text is better aligned between spinner progress and bar progress styles. Generally, push progress bars a bit more down to the place where we can track progress. This includes adding one in the upload_blob span. Introduce another progress style template for transfers, which interprets the counter as bytes (not just a plain integer), and also a data rate. Use it for here and in the fetching code, and also make the progress bar itself a bit less wide. Change-Id: I15c2ea3d2b24b5186cec19cd3dbd706638497f40 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11845 Tested-by: BuildkiteCI Autosubmit: flokli <flokli@flokli.de> Reviewed-by: Simon Hauser <simon.hauser@helsinki-systems.de>
Diffstat (limited to 'tvix/store/src')
-rw-r--r-- | tvix/store/src/bin/tvix-store.rs | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/tvix/store/src/bin/tvix-store.rs b/tvix/store/src/bin/tvix-store.rs index 9e81e59f12b9..2a039fbebed7 100644 --- a/tvix/store/src/bin/tvix-store.rs +++ b/tvix/store/src/bin/tvix-store.rs @@ -192,7 +192,7 @@ fn default_threads() -> usize { .unwrap_or(4) } -#[instrument(fields(indicatif.pb_show=1), skip(cli))] +#[instrument(skip_all)] async fn run_cli(cli: Cli) -> Result<(), Box<dyn std::error::Error>> { match cli.command { Commands::Daemon { @@ -270,19 +270,9 @@ async fn run_cli(cli: Cli) -> Result<(), Box<dyn std::error::Error>> { let nar_calculation_service: Arc<dyn NarCalculationService> = nar_calculation_service.into(); - let root_span = { - let s = Span::current(); - s.pb_set_style(&tvix_tracing::PB_PROGRESS_STYLE); - s.pb_set_message("Importing paths"); - s.pb_set_length(paths.len() as u64); - s.pb_start(); - s - }; - let tasks = paths .into_iter() .map(|path| { - let paths_span = root_span.clone(); tokio::task::spawn({ let blob_service = blob_service.clone(); let directory_service = directory_service.clone(); @@ -305,7 +295,6 @@ async fn run_cli(cli: Cli) -> Result<(), Box<dyn std::error::Error>> { println!("{}", output_path.to_absolute_path()); } } - paths_span.pb_inc(1); } }) }) @@ -512,7 +501,6 @@ async fn run_cli(cli: Cli) -> Result<(), Box<dyn std::error::Error>> { } #[tokio::main] -#[instrument(fields(indicatif.pb_show=1))] async fn main() -> Result<(), Box<dyn std::error::Error>> { let cli = Cli::parse(); |