mirror of https://github.com/containers/podman.git
				
				
				
			Merge pull request #21123 from containers/renovate/github.com-shirou-gopsutil-v3-3.x
fix(deps): update module github.com/shirou/gopsutil/v3 to v3.23.12
This commit is contained in:
		
						commit
						4f8154ca16
					
				
							
								
								
									
										2
									
								
								go.mod
								
								
								
								
							
							
						
						
									
										2
									
								
								go.mod
								
								
								
								
							|  | @ -55,7 +55,7 @@ require ( | ||||||
| 	github.com/opencontainers/selinux v1.11.0 | 	github.com/opencontainers/selinux v1.11.0 | ||||||
| 	github.com/openshift/imagebuilder v1.2.6-0.20231127234745-ef2a5fe47510 | 	github.com/openshift/imagebuilder v1.2.6-0.20231127234745-ef2a5fe47510 | ||||||
| 	github.com/rootless-containers/rootlesskit v1.1.1 | 	github.com/rootless-containers/rootlesskit v1.1.1 | ||||||
| 	github.com/shirou/gopsutil/v3 v3.23.11 | 	github.com/shirou/gopsutil/v3 v3.23.12 | ||||||
| 	github.com/sirupsen/logrus v1.9.3 | 	github.com/sirupsen/logrus v1.9.3 | ||||||
| 	github.com/spf13/cobra v1.8.0 | 	github.com/spf13/cobra v1.8.0 | ||||||
| 	github.com/spf13/pflag v1.0.5 | 	github.com/spf13/pflag v1.0.5 | ||||||
|  |  | ||||||
							
								
								
									
										4
									
								
								go.sum
								
								
								
								
							
							
						
						
									
										4
									
								
								go.sum
								
								
								
								
							|  | @ -964,8 +964,8 @@ github.com/secure-systems-lab/go-securesystemslib v0.7.0/go.mod h1:/2gYnlnHVQ6xe | ||||||
| github.com/segmentio/ksuid v1.0.4 h1:sBo2BdShXjmcugAMwjugoGUdUV0pcxY5mW4xKRn3v4c= | github.com/segmentio/ksuid v1.0.4 h1:sBo2BdShXjmcugAMwjugoGUdUV0pcxY5mW4xKRn3v4c= | ||||||
| github.com/segmentio/ksuid v1.0.4/go.mod h1:/XUiZBD3kVx5SmUOl55voK5yeAbBNNIed+2O73XgrPE= | github.com/segmentio/ksuid v1.0.4/go.mod h1:/XUiZBD3kVx5SmUOl55voK5yeAbBNNIed+2O73XgrPE= | ||||||
| github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ= | github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ= | ||||||
| github.com/shirou/gopsutil/v3 v3.23.11 h1:i3jP9NjCPUz7FiZKxlMnODZkdSIp2gnzfrvsu9CuWEQ= | github.com/shirou/gopsutil/v3 v3.23.12 h1:z90NtUkp3bMtmICZKpC4+WaknU1eXtp5vtbQ11DgpE4= | ||||||
| github.com/shirou/gopsutil/v3 v3.23.11/go.mod h1:1FrWgea594Jp7qmjHUUPlJDTPgcsb9mGnXDxavtikzM= | github.com/shirou/gopsutil/v3 v3.23.12/go.mod h1:1FrWgea594Jp7qmjHUUPlJDTPgcsb9mGnXDxavtikzM= | ||||||
| github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= | github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= | ||||||
| github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= | github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= | ||||||
| github.com/shoenig/test v0.6.4 h1:kVTaSd7WLz5WZ2IaoM0RSzRsUD+m8wRR+5qvntpn4LU= | github.com/shoenig/test v0.6.4 h1:kVTaSd7WLz5WZ2IaoM0RSzRsUD+m8wRR+5qvntpn4LU= | ||||||
|  |  | ||||||
|  | @ -5,15 +5,12 @@ package cpu | ||||||
| 
 | 
 | ||||||
| import ( | import ( | ||||||
| 	"context" | 	"context" | ||||||
| 	"regexp" |  | ||||||
| 	"strconv" | 	"strconv" | ||||||
| 	"strings" | 	"strings" | ||||||
| 
 | 
 | ||||||
| 	"github.com/shirou/gopsutil/v3/internal/common" | 	"github.com/shirou/gopsutil/v3/internal/common" | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| var whiteSpaces = regexp.MustCompile(`\s+`) |  | ||||||
| 
 |  | ||||||
| func TimesWithContext(ctx context.Context, percpu bool) ([]TimesStat, error) { | func TimesWithContext(ctx context.Context, percpu bool) ([]TimesStat, error) { | ||||||
| 	if percpu { | 	if percpu { | ||||||
| 		return []TimesStat{}, common.ErrNotImplementedError | 		return []TimesStat{}, common.ErrNotImplementedError | ||||||
|  | @ -28,8 +25,8 @@ func TimesWithContext(ctx context.Context, percpu bool) ([]TimesStat, error) { | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| 		ret := TimesStat{CPU: "cpu-total"} | 		ret := TimesStat{CPU: "cpu-total"} | ||||||
| 		h := whiteSpaces.Split(lines[len(lines)-3], -1) // headers
 | 		h := strings.Fields(lines[len(lines)-3]) // headers
 | ||||||
| 		v := whiteSpaces.Split(lines[len(lines)-2], -1) // values
 | 		v := strings.Fields(lines[len(lines)-2]) // values
 | ||||||
| 		for i, header := range h { | 		for i, header := range h { | ||||||
| 			if t, err := strconv.ParseFloat(v[i], 64); err == nil { | 			if t, err := strconv.ParseFloat(v[i], 64); err == nil { | ||||||
| 				switch header { | 				switch header { | ||||||
|  | @ -58,14 +55,14 @@ func InfoWithContext(ctx context.Context) ([]InfoStat, error) { | ||||||
| 	ret := InfoStat{} | 	ret := InfoStat{} | ||||||
| 	for _, line := range strings.Split(string(out), "\n") { | 	for _, line := range strings.Split(string(out), "\n") { | ||||||
| 		if strings.HasPrefix(line, "Number Of Processors:") { | 		if strings.HasPrefix(line, "Number Of Processors:") { | ||||||
| 			p := whiteSpaces.Split(line, 4) | 			p := strings.Fields(line) | ||||||
| 			if len(p) > 3 { | 			if len(p) > 3 { | ||||||
| 				if t, err := strconv.ParseUint(p[3], 10, 64); err == nil { | 				if t, err := strconv.ParseUint(p[3], 10, 64); err == nil { | ||||||
| 					ret.Cores = int32(t) | 					ret.Cores = int32(t) | ||||||
| 				} | 				} | ||||||
| 			} | 			} | ||||||
| 		} else if strings.HasPrefix(line, "Processor Clock Speed:") { | 		} else if strings.HasPrefix(line, "Processor Clock Speed:") { | ||||||
| 			p := whiteSpaces.Split(line, 5) | 			p := strings.Fields(line) | ||||||
| 			if len(p) > 4 { | 			if len(p) > 4 { | ||||||
| 				if t, err := strconv.ParseFloat(p[3], 64); err == nil { | 				if t, err := strconv.ParseFloat(p[3], 64); err == nil { | ||||||
| 					switch strings.ToUpper(p[4]) { | 					switch strings.ToUpper(p[4]) { | ||||||
|  |  | ||||||
|  | @ -36,6 +36,8 @@ func Times(percpu bool) ([]TimesStat, error) { | ||||||
| 	return TimesWithContext(context.Background(), percpu) | 	return TimesWithContext(context.Background(), percpu) | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | var kstatSplit = regexp.MustCompile(`[:\s]+`) | ||||||
|  | 
 | ||||||
| func TimesWithContext(ctx context.Context, percpu bool) ([]TimesStat, error) { | func TimesWithContext(ctx context.Context, percpu bool) ([]TimesStat, error) { | ||||||
| 	kstatSysOut, err := invoke.CommandWithContext(ctx, "kstat", "-p", "cpu_stat:*:*:/^idle$|^user$|^kernel$|^iowait$|^swap$/") | 	kstatSysOut, err := invoke.CommandWithContext(ctx, "kstat", "-p", "cpu_stat:*:*:/^idle$|^user$|^kernel$|^iowait$|^swap$/") | ||||||
| 	if err != nil { | 	if err != nil { | ||||||
|  | @ -47,9 +49,8 @@ func TimesWithContext(ctx context.Context, percpu bool) ([]TimesStat, error) { | ||||||
| 	kern := make(map[float64]float64) | 	kern := make(map[float64]float64) | ||||||
| 	iowt := make(map[float64]float64) | 	iowt := make(map[float64]float64) | ||||||
| 	// swap := make(map[float64]float64)
 | 	// swap := make(map[float64]float64)
 | ||||||
| 	re := regexp.MustCompile(`[:\s]+`) |  | ||||||
| 	for _, line := range strings.Split(string(kstatSysOut), "\n") { | 	for _, line := range strings.Split(string(kstatSysOut), "\n") { | ||||||
| 		fields := re.Split(line, -1) | 		fields := kstatSplit.Split(line, -1) | ||||||
| 		if fields[0] != "cpu_stat" { | 		if fields[0] != "cpu_stat" { | ||||||
| 			continue | 			continue | ||||||
| 		} | 		} | ||||||
|  |  | ||||||
|  | @ -5,15 +5,12 @@ package mem | ||||||
| 
 | 
 | ||||||
| import ( | import ( | ||||||
| 	"context" | 	"context" | ||||||
| 	"regexp" |  | ||||||
| 	"strconv" | 	"strconv" | ||||||
| 	"strings" | 	"strings" | ||||||
| 
 | 
 | ||||||
| 	"github.com/shirou/gopsutil/v3/internal/common" | 	"github.com/shirou/gopsutil/v3/internal/common" | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| var whiteSpaces = regexp.MustCompile(`\s+`) |  | ||||||
| 
 |  | ||||||
| func VirtualMemoryWithContext(ctx context.Context) (*VirtualMemoryStat, error) { | func VirtualMemoryWithContext(ctx context.Context) (*VirtualMemoryStat, error) { | ||||||
| 	vmem, swap, err := callSVMon(ctx) | 	vmem, swap, err := callSVMon(ctx) | ||||||
| 	if err != nil { | 	if err != nil { | ||||||
|  | @ -49,7 +46,7 @@ func callSVMon(ctx context.Context) (*VirtualMemoryStat, *SwapMemoryStat, error) | ||||||
| 	swap := &SwapMemoryStat{} | 	swap := &SwapMemoryStat{} | ||||||
| 	for _, line := range strings.Split(string(out), "\n") { | 	for _, line := range strings.Split(string(out), "\n") { | ||||||
| 		if strings.HasPrefix(line, "memory") { | 		if strings.HasPrefix(line, "memory") { | ||||||
| 			p := whiteSpaces.Split(line, 7) | 			p := strings.Fields(line) | ||||||
| 			if len(p) > 2 { | 			if len(p) > 2 { | ||||||
| 				if t, err := strconv.ParseUint(p[1], 10, 64); err == nil { | 				if t, err := strconv.ParseUint(p[1], 10, 64); err == nil { | ||||||
| 					vmem.Total = t * pagesize | 					vmem.Total = t * pagesize | ||||||
|  | @ -65,7 +62,7 @@ func callSVMon(ctx context.Context) (*VirtualMemoryStat, *SwapMemoryStat, error) | ||||||
| 				} | 				} | ||||||
| 			} | 			} | ||||||
| 		} else if strings.HasPrefix(line, "pg space") { | 		} else if strings.HasPrefix(line, "pg space") { | ||||||
| 			p := whiteSpaces.Split(line, 4) | 			p := strings.Fields(line) | ||||||
| 			if len(p) > 3 { | 			if len(p) > 3 { | ||||||
| 				if t, err := strconv.ParseUint(p[2], 10, 64); err == nil { | 				if t, err := strconv.ParseUint(p[2], 10, 64); err == nil { | ||||||
| 					swap.Total = t * pagesize | 					swap.Total = t * pagesize | ||||||
|  |  | ||||||
|  | @ -23,6 +23,8 @@ func IOCounters(pernic bool) ([]IOCountersStat, error) { | ||||||
| 	return IOCountersWithContext(context.Background(), pernic) | 	return IOCountersWithContext(context.Background(), pernic) | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | var kstatSplit = regexp.MustCompile(`[:\s]+`) | ||||||
|  | 
 | ||||||
| func IOCountersWithContext(ctx context.Context, pernic bool) ([]IOCountersStat, error) { | func IOCountersWithContext(ctx context.Context, pernic bool) ([]IOCountersStat, error) { | ||||||
| 	// collect all the net class's links with below statistics
 | 	// collect all the net class's links with below statistics
 | ||||||
| 	filterstr := "/^(?!vnic)/::phys:/^rbytes64$|^ipackets64$|^idrops64$|^ierrors$|^obytes64$|^opackets64$|^odrops64$|^oerrors$/" | 	filterstr := "/^(?!vnic)/::phys:/^rbytes64$|^ipackets64$|^idrops64$|^ierrors$|^obytes64$|^opackets64$|^odrops64$|^oerrors$/" | ||||||
|  | @ -47,9 +49,8 @@ func IOCountersWithContext(ctx context.Context, pernic bool) ([]IOCountersStat, | ||||||
| 	odrops64arr := make(map[string]uint64) | 	odrops64arr := make(map[string]uint64) | ||||||
| 	oerrorsarr := make(map[string]uint64) | 	oerrorsarr := make(map[string]uint64) | ||||||
| 
 | 
 | ||||||
| 	re := regexp.MustCompile(`[:\s]+`) |  | ||||||
| 	for _, line := range lines { | 	for _, line := range lines { | ||||||
| 		fields := re.Split(line, -1) | 		fields := kstatSplit.Split(line, -1) | ||||||
| 		interfaceName := fields[0] | 		interfaceName := fields[0] | ||||||
| 		instance := fields[1] | 		instance := fields[1] | ||||||
| 		switch fields[3] { | 		switch fields[3] { | ||||||
|  |  | ||||||
|  | @ -950,7 +950,7 @@ github.com/secure-systems-lab/go-securesystemslib/encrypted | ||||||
| # github.com/segmentio/ksuid v1.0.4 | # github.com/segmentio/ksuid v1.0.4 | ||||||
| ## explicit; go 1.12 | ## explicit; go 1.12 | ||||||
| github.com/segmentio/ksuid | github.com/segmentio/ksuid | ||||||
| # github.com/shirou/gopsutil/v3 v3.23.11 | # github.com/shirou/gopsutil/v3 v3.23.12 | ||||||
| ## explicit; go 1.15 | ## explicit; go 1.15 | ||||||
| github.com/shirou/gopsutil/v3/common | github.com/shirou/gopsutil/v3/common | ||||||
| github.com/shirou/gopsutil/v3/cpu | github.com/shirou/gopsutil/v3/cpu | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue