feat: show proc peak [force build]
All checks were successful
submodules sync / sync (push) Successful in 34s
build / build (push) Successful in 1m23s
build / trigger-build-image (push) Successful in 8s

This commit is contained in:
张泊明518370910136 2025-06-02 19:02:31 -04:00
parent 44446f91c1
commit b809488c71
GPG Key ID: D47306D7062CDA9D
4 changed files with 7 additions and 1 deletions

View File

@ -147,8 +147,9 @@ func convertPBResult(res []*pb.Response_Result) []stage.ExecutorResult {
ExitStatus: int(r.ExitStatus),
Error: r.Error,
Time: r.Time,
RunTime: r.RunTime,
Memory: r.Memory,
RunTime: r.RunTime,
ProcPeak: r.ProcPeak,
Files: convertFiles(r.Files),
Buffs: r.Files,
FileIDs: r.FileIDs,

View File

@ -13,6 +13,7 @@ type Conf struct {
ShowTime bool `default:"true"`
ShowMemory bool `default:"true"`
ShowRunTime bool `default:"false"`
ShowProcPeak bool `default:"false"`
ShowFiles []string
FilesInCodeBlock bool `default:"true"`
MaxFileLength int `default:"2048"`

View File

@ -39,6 +39,9 @@ func (*ResultDetail) Run(results []stage.ExecutorResult, confAny any) (
if conf.ShowRunTime {
comment += fmt.Sprintf("RunTime: `%d ms`\n", result.RunTime/1e6)
}
if conf.ShowProcPeak {
comment += fmt.Sprintf("ProcPeak: `%d`\n", result.ProcPeak)
}
for _, file := range conf.ShowFiles {
content, ok := result.Files[file]
comment += fmt.Sprintf("File `%s`:\n", file)

View File

@ -25,6 +25,7 @@ type ExecutorResult struct {
Time uint64 `json:"time"` // ns (cgroup recorded time)
Memory uint64 `json:"memory"` // byte
RunTime uint64 `json:"runTime"` // ns (wall clock time)
ProcPeak uint64 `json:"procPeak"`
Files map[string]string `json:"files,omitempty"`
FileIDs map[string]string `json:"fileIds,omitempty"`
FileError []FileError `json:"fileError,omitempty"`