github.com/hhrutter/nomad@v0.6.0-rc2.0.20170723054333-80c4b03f0705/client/driver/executor/executor_basic.go (about) 1 // +build darwin dragonfly freebsd netbsd openbsd solaris windows 2 3 package executor 4 5 import ( 6 "os" 7 8 cstructs "github.com/hashicorp/nomad/client/structs" 9 "github.com/mitchellh/go-ps" 10 ) 11 12 func (e *UniversalExecutor) configureChroot() error { 13 return nil 14 } 15 16 func (e *UniversalExecutor) removeChrootMounts() error { 17 return nil 18 } 19 20 func (e *UniversalExecutor) runAs(userid string) error { 21 return nil 22 } 23 24 func (e *UniversalExecutor) applyLimits(pid int) error { 25 return nil 26 } 27 28 func (e *UniversalExecutor) configureIsolation() error { 29 return nil 30 } 31 32 func (e *UniversalExecutor) Stats() (*cstructs.TaskResourceUsage, error) { 33 pidStats, err := e.pidStats() 34 if err != nil { 35 return nil, err 36 } 37 return e.aggregatedResourceUsage(pidStats), nil 38 } 39 40 func (e *UniversalExecutor) getAllPids() (map[int]*nomadPid, error) { 41 allProcesses, err := ps.Processes() 42 if err != nil { 43 return nil, err 44 } 45 return e.scanPids(os.Getpid(), allProcesses) 46 }