feat(executor): only log pbCmd & pbReq size
All checks were successful
submodules sync / sync (push) Successful in 41s
build / build (push) Successful in 1m23s
build / trigger-build-image (push) Successful in 8s

This commit is contained in:
张泊明518370910136 2024-11-06 08:08:16 -05:00
parent 153c261ab8
commit 58b69523aa
GPG Key ID: D47306D7062CDA9D

View File

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