From 1fde904bc39c978db6601990fd5652fcc4da7fbb Mon Sep 17 00:00:00 2001 From: Nate Maninger Date: Thu, 30 Nov 2023 13:52:16 -0800 Subject: [PATCH] sia: add logging for elapsed --- sia/store.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sia/store.go b/sia/store.go index ab3dc34..ffb8e45 100644 --- a/sia/store.go +++ b/sia/store.go @@ -4,6 +4,7 @@ import ( "context" "errors" "fmt" + "time" "github.com/gogo/protobuf/proto" "github.com/ipfs/boxo/ipld/merkledag" @@ -102,10 +103,12 @@ func (bs *RenterdBlockStore) Get(ctx context.Context, c cid.Cid) (blocks.Block, log := bs.log.With(zap.Stringer("cid", c), zap.String("dataBucket", cm.Data.Bucket), zap.String("dataKey", cm.Data.Key), zap.String("metaBucket", cm.Metadata.Bucket), zap.String("metaKey", cm.Metadata.Key), zap.Uint64("blockSize", cm.Data.BlockSize), zap.Uint64("blockOffset", cm.Data.Offset), zap.Uint64("metadataSize", cm.Metadata.Length), zap.Uint64("metadataOffset", cm.Metadata.Offset)) log.Debug("downloading block") + start := time.Now() block, err := bs.downloadBlock(ctx, cm) if err != nil { log.Error("failed to download block", zap.Error(err)) } + log.Debug("block downloaded", zap.Duration("elapsed", time.Since(start))) return block, err }