diff --git a/internal/service/runner/container.go b/internal/service/runner/container.go index 518d80c..4a9c473 100644 --- a/internal/service/runner/container.go +++ b/internal/service/runner/container.go @@ -165,11 +165,11 @@ func (s *service) ContainerRun(arg *RunArgs) (RuntimeStatus, error) { case *cgv1.Metrics: runtime.CpuTime = int(v.CPU.Usage.Total / 1000000) // nanoseconds to milliseconds runtime.Memory = int(v.Memory.Usage.Max / 1024) // bytes to kilobytes - runtime.RealTime = runtime.CpuTime + runtime.RealTime = 0 // not supported case *cgv2.Metrics: runtime.CpuTime = int(v.CPU.UsageUsec / 1000) // microseconds to milliseconds runtime.Memory = int(v.Memory.MaxUsage / 1024) // bytes to kilobytes - runtime.RealTime = runtime.CpuTime + runtime.RealTime = 0 // not supported default: return RuntimeStatus{}, errors.New("cannot convert metric data to cgroups.{v1/v2}.Metrics") } diff --git a/internal/service/runner/status.go b/internal/service/runner/status.go index c921b1e..c88e175 100644 --- a/internal/service/runner/status.go +++ b/internal/service/runner/status.go @@ -82,9 +82,9 @@ func (t *TaskStatus) ExtractSandboxInfo() *TaskStatus { t.Message = "cannot parse info file" } else { t.Runtime = RuntimeStatus{ - RealTime: t.info["real_time"].(int), - CpuTime: t.info["cpu_time"].(int), - Memory: t.info["memory"].(int), + RealTime: int(t.info["real_time"].(float64)), + CpuTime: int(t.info["cpu_time"].(float64)), + Memory: int(t.info["memory"].(float64)), } } @@ -136,7 +136,7 @@ func (t *TaskStatus) CheckExitCode() *TaskStatus { return t } - if t.info["status"] != "exited" || t.info["code"] != 0 { + if t.info["status"] != "exited" || t.info["code"] != 0.0 { t.Verdict = VerdictRuntimeError t.Message = fmt.Sprintf("status: %v, code: %v", t.info["status"], t.info["code"]) }