Skip to content

Commit

Permalink
Merge pull request #979 from marquiz/backports/release-0.8-968
Browse files Browse the repository at this point in the history
[release-0.8] metrics: fix collecting hugetlb statistics from cgroup v1
  • Loading branch information
jukkar authored Feb 21, 2023
2 parents 5843e99 + 0690f20 commit b340806
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/cgroups/cgroupstats.go
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,10 @@ func GetHugetlbUsage(cgroupPath string) ([]HugetlbUsage, error) {
result := make([]HugetlbUsage, 0, len(usageFiles))

for _, file := range usageFiles {
if strings.Contains(filepath.Base(file), ".rsvd") {
// Skip reservations files.
continue
}
size := strings.SplitN(filepath.Base(file), ".", 3)[1]
bytes, err := readCgroupSingleNumber(file)
if err != nil {
Expand Down

0 comments on commit b340806

Please sign in to comment.