mirror of
https://github.com/containers/podman.git
synced 2025-11-30 18:18:18 +08:00
fix(deps): update module github.com/shirou/gopsutil/v3 to v3.23.12
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
This commit is contained in:
11
vendor/github.com/shirou/gopsutil/v3/cpu/cpu_aix_nocgo.go
generated
vendored
11
vendor/github.com/shirou/gopsutil/v3/cpu/cpu_aix_nocgo.go
generated
vendored
@@ -5,15 +5,12 @@ package cpu
|
||||
|
||||
import (
|
||||
"context"
|
||||
"regexp"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/shirou/gopsutil/v3/internal/common"
|
||||
)
|
||||
|
||||
var whiteSpaces = regexp.MustCompile(`\s+`)
|
||||
|
||||
func TimesWithContext(ctx context.Context, percpu bool) ([]TimesStat, error) {
|
||||
if percpu {
|
||||
return []TimesStat{}, common.ErrNotImplementedError
|
||||
@@ -28,8 +25,8 @@ func TimesWithContext(ctx context.Context, percpu bool) ([]TimesStat, error) {
|
||||
}
|
||||
|
||||
ret := TimesStat{CPU: "cpu-total"}
|
||||
h := whiteSpaces.Split(lines[len(lines)-3], -1) // headers
|
||||
v := whiteSpaces.Split(lines[len(lines)-2], -1) // values
|
||||
h := strings.Fields(lines[len(lines)-3]) // headers
|
||||
v := strings.Fields(lines[len(lines)-2]) // values
|
||||
for i, header := range h {
|
||||
if t, err := strconv.ParseFloat(v[i], 64); err == nil {
|
||||
switch header {
|
||||
@@ -58,14 +55,14 @@ func InfoWithContext(ctx context.Context) ([]InfoStat, error) {
|
||||
ret := InfoStat{}
|
||||
for _, line := range strings.Split(string(out), "\n") {
|
||||
if strings.HasPrefix(line, "Number Of Processors:") {
|
||||
p := whiteSpaces.Split(line, 4)
|
||||
p := strings.Fields(line)
|
||||
if len(p) > 3 {
|
||||
if t, err := strconv.ParseUint(p[3], 10, 64); err == nil {
|
||||
ret.Cores = int32(t)
|
||||
}
|
||||
}
|
||||
} else if strings.HasPrefix(line, "Processor Clock Speed:") {
|
||||
p := whiteSpaces.Split(line, 5)
|
||||
p := strings.Fields(line)
|
||||
if len(p) > 4 {
|
||||
if t, err := strconv.ParseFloat(p[3], 64); err == nil {
|
||||
switch strings.ToUpper(p[4]) {
|
||||
|
||||
5
vendor/github.com/shirou/gopsutil/v3/cpu/cpu_solaris.go
generated
vendored
5
vendor/github.com/shirou/gopsutil/v3/cpu/cpu_solaris.go
generated
vendored
@@ -36,6 +36,8 @@ func Times(percpu bool) ([]TimesStat, error) {
|
||||
return TimesWithContext(context.Background(), percpu)
|
||||
}
|
||||
|
||||
var kstatSplit = regexp.MustCompile(`[:\s]+`)
|
||||
|
||||
func TimesWithContext(ctx context.Context, percpu bool) ([]TimesStat, error) {
|
||||
kstatSysOut, err := invoke.CommandWithContext(ctx, "kstat", "-p", "cpu_stat:*:*:/^idle$|^user$|^kernel$|^iowait$|^swap$/")
|
||||
if err != nil {
|
||||
@@ -47,9 +49,8 @@ func TimesWithContext(ctx context.Context, percpu bool) ([]TimesStat, error) {
|
||||
kern := make(map[float64]float64)
|
||||
iowt := make(map[float64]float64)
|
||||
// swap := make(map[float64]float64)
|
||||
re := regexp.MustCompile(`[:\s]+`)
|
||||
for _, line := range strings.Split(string(kstatSysOut), "\n") {
|
||||
fields := re.Split(line, -1)
|
||||
fields := kstatSplit.Split(line, -1)
|
||||
if fields[0] != "cpu_stat" {
|
||||
continue
|
||||
}
|
||||
|
||||
7
vendor/github.com/shirou/gopsutil/v3/mem/mem_aix_nocgo.go
generated
vendored
7
vendor/github.com/shirou/gopsutil/v3/mem/mem_aix_nocgo.go
generated
vendored
@@ -5,15 +5,12 @@ package mem
|
||||
|
||||
import (
|
||||
"context"
|
||||
"regexp"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/shirou/gopsutil/v3/internal/common"
|
||||
)
|
||||
|
||||
var whiteSpaces = regexp.MustCompile(`\s+`)
|
||||
|
||||
func VirtualMemoryWithContext(ctx context.Context) (*VirtualMemoryStat, error) {
|
||||
vmem, swap, err := callSVMon(ctx)
|
||||
if err != nil {
|
||||
@@ -49,7 +46,7 @@ func callSVMon(ctx context.Context) (*VirtualMemoryStat, *SwapMemoryStat, error)
|
||||
swap := &SwapMemoryStat{}
|
||||
for _, line := range strings.Split(string(out), "\n") {
|
||||
if strings.HasPrefix(line, "memory") {
|
||||
p := whiteSpaces.Split(line, 7)
|
||||
p := strings.Fields(line)
|
||||
if len(p) > 2 {
|
||||
if t, err := strconv.ParseUint(p[1], 10, 64); err == nil {
|
||||
vmem.Total = t * pagesize
|
||||
@@ -65,7 +62,7 @@ func callSVMon(ctx context.Context) (*VirtualMemoryStat, *SwapMemoryStat, error)
|
||||
}
|
||||
}
|
||||
} else if strings.HasPrefix(line, "pg space") {
|
||||
p := whiteSpaces.Split(line, 4)
|
||||
p := strings.Fields(line)
|
||||
if len(p) > 3 {
|
||||
if t, err := strconv.ParseUint(p[2], 10, 64); err == nil {
|
||||
swap.Total = t * pagesize
|
||||
|
||||
5
vendor/github.com/shirou/gopsutil/v3/net/net_solaris.go
generated
vendored
5
vendor/github.com/shirou/gopsutil/v3/net/net_solaris.go
generated
vendored
@@ -23,6 +23,8 @@ func IOCounters(pernic bool) ([]IOCountersStat, error) {
|
||||
return IOCountersWithContext(context.Background(), pernic)
|
||||
}
|
||||
|
||||
var kstatSplit = regexp.MustCompile(`[:\s]+`)
|
||||
|
||||
func IOCountersWithContext(ctx context.Context, pernic bool) ([]IOCountersStat, error) {
|
||||
// collect all the net class's links with below statistics
|
||||
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)
|
||||
oerrorsarr := make(map[string]uint64)
|
||||
|
||||
re := regexp.MustCompile(`[:\s]+`)
|
||||
for _, line := range lines {
|
||||
fields := re.Split(line, -1)
|
||||
fields := kstatSplit.Split(line, -1)
|
||||
interfaceName := fields[0]
|
||||
instance := fields[1]
|
||||
switch fields[3] {
|
||||
|
||||
Reference in New Issue
Block a user