mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-04 12:18:16 +00:00 
			
		
		
		
	bump github.com/prometheus/client_model, github.com/prometheus/profcs to preferred versions
This commit is contained in:
		
							
								
								
									
										37
									
								
								vendor/github.com/prometheus/procfs/xfs/parse.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										37
									
								
								vendor/github.com/prometheus/procfs/xfs/parse.go
									
									
									
										generated
									
									
										vendored
									
									
								
							@@ -17,8 +17,9 @@ import (
 | 
			
		||||
	"bufio"
 | 
			
		||||
	"fmt"
 | 
			
		||||
	"io"
 | 
			
		||||
	"strconv"
 | 
			
		||||
	"strings"
 | 
			
		||||
 | 
			
		||||
	"github.com/prometheus/procfs/internal/util"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
// ParseStats parses a Stats from an input io.Reader, using the format
 | 
			
		||||
@@ -68,7 +69,7 @@ func ParseStats(r io.Reader) (*Stats, error) {
 | 
			
		||||
 | 
			
		||||
		// Extended precision counters are uint64 values.
 | 
			
		||||
		if label == fieldXpc {
 | 
			
		||||
			us, err := parseUint64s(ss[1:])
 | 
			
		||||
			us, err := util.ParseUint64s(ss[1:])
 | 
			
		||||
			if err != nil {
 | 
			
		||||
				return nil, err
 | 
			
		||||
			}
 | 
			
		||||
@@ -82,7 +83,7 @@ func ParseStats(r io.Reader) (*Stats, error) {
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		// All other counters are uint32 values.
 | 
			
		||||
		us, err := parseUint32s(ss[1:])
 | 
			
		||||
		us, err := util.ParseUint32s(ss[1:])
 | 
			
		||||
		if err != nil {
 | 
			
		||||
			return nil, err
 | 
			
		||||
		}
 | 
			
		||||
@@ -327,33 +328,3 @@ func extendedPrecisionStats(us []uint64) (ExtendedPrecisionStats, error) {
 | 
			
		||||
		ReadBytes:  us[2],
 | 
			
		||||
	}, nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// parseUint32s parses a slice of strings into a slice of uint32s.
 | 
			
		||||
func parseUint32s(ss []string) ([]uint32, error) {
 | 
			
		||||
	us := make([]uint32, 0, len(ss))
 | 
			
		||||
	for _, s := range ss {
 | 
			
		||||
		u, err := strconv.ParseUint(s, 10, 32)
 | 
			
		||||
		if err != nil {
 | 
			
		||||
			return nil, err
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		us = append(us, uint32(u))
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return us, nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// parseUint64s parses a slice of strings into a slice of uint64s.
 | 
			
		||||
func parseUint64s(ss []string) ([]uint64, error) {
 | 
			
		||||
	us := make([]uint64, 0, len(ss))
 | 
			
		||||
	for _, s := range ss {
 | 
			
		||||
		u, err := strconv.ParseUint(s, 10, 64)
 | 
			
		||||
		if err != nil {
 | 
			
		||||
			return nil, err
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		us = append(us, u)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return us, nil
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user