feat(executor): debug log total protobuf cmds size
All checks were successful
submodules sync / sync (push) Successful in 41s
build / build (push) Successful in 1m28s
build / trigger-build-image (push) Successful in 8s

This commit is contained in:
张泊明518370910136 2024-11-06 07:14:53 -05:00
parent ce794f1315
commit 0cb1a63025
GPG Key ID: D47306D7062CDA9D

View File

@ -38,11 +38,14 @@ func (e *Sandbox) Run(cmds []stage.Cmd) ([]stage.ExecutorResult, error) {
} }
} }
pbCmds := convertPBCmd(cmds) pbCmds := convertPBCmd(cmds)
totalPbCmdSize := 0
for i, pbCmd := range pbCmds { for i, pbCmd := range pbCmds {
pbCmdSize := proto.Size(pbCmd)
totalPbCmdSize += pbCmdSize
slog.Debug( slog.Debug(
"sandbox execute", "sandbox execute",
"index", i, "index", i,
"protobuf cmd size", proto.Size(pbCmd), "protobuf cmd size", pbCmdSize,
"protobuf cmd stdin size", proto.Size(pbCmd.Files[0]), "protobuf cmd stdin size", proto.Size(pbCmd.Files[0]),
"protobuf cmd stdout size", proto.Size(pbCmd.Files[1]), "protobuf cmd stdout size", proto.Size(pbCmd.Files[1]),
"protobuf cmd stderr size", proto.Size(pbCmd.Files[2]), "protobuf cmd stderr size", proto.Size(pbCmd.Files[2]),
@ -56,6 +59,7 @@ func (e *Sandbox) Run(cmds []stage.Cmd) ([]stage.ExecutorResult, error) {
) )
} }
} }
slog.Debug("sandbox execute", "total protobuf cmd size", totalPbCmdSize)
pbReq := &pb.Request{Cmd: pbCmds} pbReq := &pb.Request{Cmd: pbCmds}
pbRet, err := e.execClient.Exec(context.TODO(), pbReq) pbRet, err := e.execClient.Exec(context.TODO(), pbReq)
if err != nil { if err != nil {