windows process exit timestamp

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby
2017-04-13 15:30:42 -07:00
parent efe177ed77
commit 5d3bc1a4a7
5 changed files with 33 additions and 27 deletions

View File

@@ -4,6 +4,7 @@ package hcs
import (
"syscall"
"time"
"github.com/Microsoft/hcsshim"
"github.com/containerd/containerd"
@@ -13,11 +14,12 @@ import (
type Process struct {
hcsshim.Process
pid uint32
io *IO
ec uint32
ecErr error
ecSync chan struct{}
pid uint32
io *IO
ec uint32
exitedAt time.Time
ecErr error
ecSync chan struct{}
}
func (p *Process) Pid() uint32 {
@@ -29,6 +31,10 @@ func (p *Process) ExitCode() (uint32, error) {
return p.ec, p.ecErr
}
func (p *Process) ExitedAt() time.Time {
return p.exitedAt
}
func (p *Process) Status() containerd.Status {
select {
case <-p.ecSync:
@@ -60,6 +66,6 @@ func processExitCode(containerID string, p *Process) (uint32, error) {
// Well, unknown exit code it is
ec = 255
}
p.exitedAt = time.Now()
return uint32(ec), err
}