about summary refs log tree commit diff
path: root/tvix/store/src/pathinfoservice
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2024-06-16T19·40+0300
committerflokli <flokli@flokli.de>2024-06-17T09·47+0000
commitcfab953094c6da5a919ea968f2bd7753035005c7 (patch)
tree120b070015a7660d619ee9f3ae0cf488c4857106 /tvix/store/src/pathinfoservice
parent71a29ceff42dd8e0266dec3811b242b3f5b4cb2f (diff)
feat(tvix/store): display progress for NAR calculation r/8288
This is currently still taking a noticeable amount of time, so make sure
we show it is happening.

Change-Id: I13d18785fbf41ae4479e1ea58d61ece1d7485719
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11847
Reviewed-by: Simon Hauser <simon.hauser@helsinki-systems.de>
Autosubmit: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/store/src/pathinfoservice')
-rw-r--r--tvix/store/src/pathinfoservice/grpc.rs9
1 files changed, 7 insertions, 2 deletions
diff --git a/tvix/store/src/pathinfoservice/grpc.rs b/tvix/store/src/pathinfoservice/grpc.rs
index f6a356cf180a..63656609354d 100644
--- a/tvix/store/src/pathinfoservice/grpc.rs
+++ b/tvix/store/src/pathinfoservice/grpc.rs
@@ -7,7 +7,8 @@ use async_stream::try_stream;
 use futures::stream::BoxStream;
 use nix_compat::nixbase32;
 use tonic::{async_trait, transport::Channel, Code};
-use tracing::instrument;
+use tracing::{instrument, Span};
+use tracing_indicatif::span_ext::IndicatifSpanExt;
 use tvix_castore::{proto as castorepb, Error};
 
 /// Connects to a (remote) tvix-store PathInfoService over gRPC.
@@ -107,11 +108,15 @@ impl PathInfoService for GRPCPathInfoService {
 
 #[async_trait]
 impl NarCalculationService for GRPCPathInfoService {
-    #[instrument(level = "trace", skip_all, fields(root_node = ?root_node))]
+    #[instrument(level = "trace", skip_all, fields(root_node = ?root_node, indicatif.pb_show=1))]
     async fn calculate_nar(
         &self,
         root_node: &castorepb::node::Node,
     ) -> Result<(u64, [u8; 32]), Error> {
+        let span = Span::current();
+        span.pb_set_message("Waiting for NAR calculation");
+        span.pb_start();
+
         let path_info = self
             .grpc_client
             .clone()