Skip to content

Commit

Permalink
Log request serialization time (Layr-Labs#625)
Browse files Browse the repository at this point in the history
  • Loading branch information
jianoaix authored Jul 8, 2024
1 parent 2fd1ef9 commit 52f1293
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions disperser/batcher/grpc/dispatcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,13 @@ func (c *dispatcher) sendChunks(ctx context.Context, blobs []*core.BlobMessage,
gc := node.NewDispersalClient(conn)
ctx, cancel := context.WithTimeout(ctx, c.Timeout)
defer cancel()
start := time.Now()
request, totalSize, err := GetStoreChunksRequest(blobs, batchHeader)
if err != nil {
return nil, err
}

c.logger.Debug("sending chunks to operator", "operator", op.Socket, "num blobs", len(blobs), "size", totalSize, "request message size", proto.Size(request), "request serialization time", time.Since(start))
opt := grpc.MaxCallSendMsgSize(60 * 1024 * 1024 * 1024)
c.logger.Debug("sending chunks to operator", "operator", op.Socket, "size", totalSize, "request message size", proto.Size(request))
reply, err := gc.StoreChunks(ctx, request, opt)

if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion node/grpc/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ func (s *Server) StoreChunks(ctx context.Context, in *pb.StoreChunksRequest) (*p
}
}
// Caveat: proto.Size() returns int, so this log will not work for larger protobuf message (over about 2GiB).
s.node.Logger.Info("StoreChunks RPC request recieved", "num of blobs", len(in.Blobs), "request message size", proto.Size(in), "total size of blob headers", blobHeadersSize, "total size of bundles", bundleSize)
s.node.Logger.Info("StoreChunks RPC request received", "num of blobs", len(in.Blobs), "request message size", proto.Size(in), "total size of blob headers", blobHeadersSize, "total size of bundles", bundleSize)

// Validate the request.
if err := s.validateStoreChunkRequest(in); err != nil {
Expand Down

0 comments on commit 52f1293

Please sign in to comment.