mirror of
				https://github.com/teddysun/across.git
				synced 2025-11-01 01:05:36 +08:00 
			
		
		
		
	Fix get Memory & Swap
This commit is contained in:
		
							
								
								
									
										4
									
								
								bench.sh
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								bench.sh
									
									
									
									
									
								
							| @@ -9,8 +9,8 @@ | |||||||
| cname=$( awk -F: '/model name/ {name=$2} END {print name}' /proc/cpuinfo | sed 's/^[ \t]*//;s/[ \t]*$//' ) | cname=$( awk -F: '/model name/ {name=$2} END {print name}' /proc/cpuinfo | sed 's/^[ \t]*//;s/[ \t]*$//' ) | ||||||
| cores=$( awk -F: '/model name/ {core++} END {print core}' /proc/cpuinfo ) | cores=$( awk -F: '/model name/ {core++} END {print core}' /proc/cpuinfo ) | ||||||
| freq=$( awk -F: '/cpu MHz/ {freq=$2} END {print freq}' /proc/cpuinfo | sed 's/^[ \t]*//;s/[ \t]*$//' ) | freq=$( awk -F: '/cpu MHz/ {freq=$2} END {print freq}' /proc/cpuinfo | sed 's/^[ \t]*//;s/[ \t]*$//' ) | ||||||
| tram=$( free -m | awk 'NR==2 {print $2}' ) | tram=$( free -m | awk '/Mem/ {print $2}' ) | ||||||
| swap=$( free -m | awk 'NR==4 {print $2}' ) | swap=$( free -m | awk '/Swap/ {print $2}' ) | ||||||
| up=$( awk '{a=$1/86400;b=($1%86400)/3600;c=($1%3600)/60;d=$1%60} {printf("%ddays, %d:%d:%d\n",a,b,c,d)}' /proc/uptime ) | up=$( awk '{a=$1/86400;b=($1%86400)/3600;c=($1%3600)/60;d=$1%60} {printf("%ddays, %d:%d:%d\n",a,b,c,d)}' /proc/uptime ) | ||||||
| opsy=$( cat /etc/issue.net | awk 'NR==1 {print}' ) | opsy=$( cat /etc/issue.net | awk 'NR==1 {print}' ) | ||||||
| arch=$( uname -m ) | arch=$( uname -m ) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user