mirror of
				https://github.com/superseriousbusiness/gotosocial.git
				synced 2025-10-30 17:22:26 -05:00 
			
		
		
		
	[chore]: Bump github.com/prometheus/client_golang from 1.19.1 to 1.20.0 (#3210)
This commit is contained in:
		
					parent
					
						
							
								ae14aa004d
							
						
					
				
			
			
				commit
				
					
						6ff8376d96
					
				
			
		
					 197 changed files with 28294 additions and 563 deletions
				
			
		
							
								
								
									
										29
									
								
								vendor/github.com/prometheus/procfs/proc_status.go
									
										
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										29
									
								
								vendor/github.com/prometheus/procfs/proc_status.go
									
										
									
										generated
									
									
										vendored
									
									
								
							|  | @ -15,6 +15,7 @@ package procfs | |||
| 
 | ||||
| import ( | ||||
| 	"bytes" | ||||
| 	"math/bits" | ||||
| 	"sort" | ||||
| 	"strconv" | ||||
| 	"strings" | ||||
|  | @ -76,9 +77,9 @@ type ProcStatus struct { | |||
| 	NonVoluntaryCtxtSwitches uint64 | ||||
| 
 | ||||
| 	// UIDs of the process (Real, effective, saved set, and filesystem UIDs) | ||||
| 	UIDs [4]string | ||||
| 	UIDs [4]uint64 | ||||
| 	// GIDs of the process (Real, effective, saved set, and filesystem GIDs) | ||||
| 	GIDs [4]string | ||||
| 	GIDs [4]uint64 | ||||
| 
 | ||||
| 	// CpusAllowedList: List of cpu cores processes are allowed to run on. | ||||
| 	CpusAllowedList []uint64 | ||||
|  | @ -113,22 +114,37 @@ func (p Proc) NewStatus() (ProcStatus, error) { | |||
| 		// convert kB to B | ||||
| 		vBytes := vKBytes * 1024 | ||||
| 
 | ||||
| 		s.fillStatus(k, v, vKBytes, vBytes) | ||||
| 		err = s.fillStatus(k, v, vKBytes, vBytes) | ||||
| 		if err != nil { | ||||
| 			return ProcStatus{}, err | ||||
| 		} | ||||
| 	} | ||||
| 
 | ||||
| 	return s, nil | ||||
| } | ||||
| 
 | ||||
| func (s *ProcStatus) fillStatus(k string, vString string, vUint uint64, vUintBytes uint64) { | ||||
| func (s *ProcStatus) fillStatus(k string, vString string, vUint uint64, vUintBytes uint64) error { | ||||
| 	switch k { | ||||
| 	case "Tgid": | ||||
| 		s.TGID = int(vUint) | ||||
| 	case "Name": | ||||
| 		s.Name = vString | ||||
| 	case "Uid": | ||||
| 		copy(s.UIDs[:], strings.Split(vString, "\t")) | ||||
| 		var err error | ||||
| 		for i, v := range strings.Split(vString, "\t") { | ||||
| 			s.UIDs[i], err = strconv.ParseUint(v, 10, bits.UintSize) | ||||
| 			if err != nil { | ||||
| 				return err | ||||
| 			} | ||||
| 		} | ||||
| 	case "Gid": | ||||
| 		copy(s.GIDs[:], strings.Split(vString, "\t")) | ||||
| 		var err error | ||||
| 		for i, v := range strings.Split(vString, "\t") { | ||||
| 			s.GIDs[i], err = strconv.ParseUint(v, 10, bits.UintSize) | ||||
| 			if err != nil { | ||||
| 				return err | ||||
| 			} | ||||
| 		} | ||||
| 	case "NSpid": | ||||
| 		s.NSpids = calcNSPidsList(vString) | ||||
| 	case "VmPeak": | ||||
|  | @ -173,6 +189,7 @@ func (s *ProcStatus) fillStatus(k string, vString string, vUint uint64, vUintByt | |||
| 		s.CpusAllowedList = calcCpusAllowedList(vString) | ||||
| 	} | ||||
| 
 | ||||
| 	return nil | ||||
| } | ||||
| 
 | ||||
| // TotalCtxtSwitches returns the total context switch. | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue