mirror of
https://github.com/rancher/os.git
synced 2025-09-02 07:15:41 +00:00
Bump libcompose and sync dependencies
This commit is contained in:
33
vendor/github.com/docker/containerd/supervisor/stats.go
generated
vendored
33
vendor/github.com/docker/containerd/supervisor/stats.go
generated
vendored
@@ -1,33 +0,0 @@
|
||||
package supervisor
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/docker/containerd/runtime"
|
||||
)
|
||||
|
||||
type StatsTask struct {
|
||||
baseTask
|
||||
ID string
|
||||
Stat chan *runtime.Stat
|
||||
}
|
||||
|
||||
func (s *Supervisor) stats(t *StatsTask) error {
|
||||
start := time.Now()
|
||||
i, ok := s.containers[t.ID]
|
||||
if !ok {
|
||||
return ErrContainerNotFound
|
||||
}
|
||||
// TODO: use workers for this
|
||||
go func() {
|
||||
s, err := i.container.Stats()
|
||||
if err != nil {
|
||||
t.ErrorCh() <- err
|
||||
return
|
||||
}
|
||||
t.ErrorCh() <- nil
|
||||
t.Stat <- s
|
||||
ContainerStatsTimer.UpdateSince(start)
|
||||
}()
|
||||
return errDeferredResponse
|
||||
}
|
Reference in New Issue
Block a user