Stat returns usage statistics for the cgroup
()
| 621 | |
| 622 | // Stat returns usage statistics for the cgroup |
| 623 | func (c *CgroupControl) Stat() (*Metrics, error) { |
| 624 | m := Metrics{} |
| 625 | found := false |
| 626 | for _, h := range handlers { |
| 627 | if err := h.Stat(c, &m); err != nil { |
| 628 | if !os.IsNotExist(errors.Cause(err)) { |
| 629 | return nil, err |
| 630 | } |
| 631 | logrus.Warningf("Failed to retrieve cgroup stats: %v", err) |
| 632 | continue |
| 633 | } |
| 634 | found = true |
| 635 | } |
| 636 | if !found { |
| 637 | return nil, ErrStatCgroup |
| 638 | } |
| 639 | return &m, nil |
| 640 | } |
| 641 | |
| 642 | func readCgroup2MapPath(path string) (map[string][]string, error) { |
| 643 | ret := map[string][]string{} |