Add more metrics collection
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
parent
d08b005ca9
commit
7d4f74474e
7 changed files with 72 additions and 29 deletions
|
@ -1,12 +1,17 @@
|
|||
package supervisor
|
||||
|
||||
import "github.com/Sirupsen/logrus"
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/Sirupsen/logrus"
|
||||
)
|
||||
|
||||
type ExitEvent struct {
|
||||
s *Supervisor
|
||||
}
|
||||
|
||||
func (h *ExitEvent) Handle(e *Event) error {
|
||||
start := time.Now()
|
||||
logrus.WithFields(logrus.Fields{"pid": e.Pid, "status": e.Status}).
|
||||
Debug("containerd: process exited")
|
||||
// is it the child process of a container
|
||||
|
@ -36,6 +41,7 @@ func (h *ExitEvent) Handle(e *Event) error {
|
|||
stopCollect := NewEvent(StopStatsEventType)
|
||||
stopCollect.ID = container.ID()
|
||||
h.s.SendEvent(stopCollect)
|
||||
ExitProcessTimer.UpdateSince(start)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue