mirror of
				https://git.proxmox.com/git/mirror_iproute2
				synced 2025-11-04 07:37:05 +00:00 
			
		
		
		
	ss: in --numeric mode, print raw numbers for data rates
ss by default shows data rates in human-readable form - as Mbps/Gbps etc. Enhance --numeric mode to show raw values in bps, without conversion. Signed-of-by: Tomasz Torcz <tomasz.torcz@nordea.com> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
This commit is contained in:
		
							parent
							
								
									c95e17dcba
								
							
						
					
					
						commit
						d791e75d74
					
				@ -28,7 +28,7 @@ Suppress header line.
 | 
			
		||||
Print each socket's data on a single line.
 | 
			
		||||
.TP
 | 
			
		||||
.B \-n, \-\-numeric
 | 
			
		||||
Do not try to resolve service names.
 | 
			
		||||
Do not try to resolve service names. Show exact bandwidth values, instead of human-readable.
 | 
			
		||||
.TP
 | 
			
		||||
.B \-r, \-\-resolve
 | 
			
		||||
Try to resolve numeric address/ports.
 | 
			
		||||
 | 
			
		||||
@ -2361,7 +2361,9 @@ static int proc_inet_split_line(char *line, char **loc, char **rem, char **data)
 | 
			
		||||
 | 
			
		||||
static char *sprint_bw(char *buf, double bw)
 | 
			
		||||
{
 | 
			
		||||
	if (bw > 1000000.)
 | 
			
		||||
	if (!resolve_services)
 | 
			
		||||
		sprintf(buf, "%.0f", bw);
 | 
			
		||||
	else if (bw > 1000000.)
 | 
			
		||||
		sprintf(buf, "%.1fM", bw / 1000000.);
 | 
			
		||||
	else if (bw > 1000.)
 | 
			
		||||
		sprintf(buf, "%.1fK", bw / 1000.);
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user