|
Какой рейтинг вас больше интересует?
|
vzubc2011-05-11 14:41:55 (читать в оригинале)This script parses /proc/user_beancounters and tries to output it in a more human-readable format.
#!/bin/sh
f=$1
test -z "$f" && f="/proc/user_beancounters"
cat $f | awk '
function hr(res, v) {
i=1
if ((res ~ /pages$/) && (v != 0)) {
v = v*4; i++
}
while (v > 1024) {
v=v/1024
i++
}
o=int(v) substr(" KMGTPEZY",i,1)
return o;
}
/^Version: / {
if ($2 != "2.5") {
print "Error: unknown version:",
$2 > "/dev/stderr"
exit 1
}
next
}
/^[[:space:]]*uid / {
next
}
/^[[:space:]]*dummy/ {
id=""
next
}
/^[[:space:]]*[0-9]+:/ {
bcid=strtonum($1)
printf "CT:%9s| held | maxheld | fails\n", bcid
id=$2
held=$3
maxheld=$4
barrier=$5
limit=$6
failcnt=$7
}
/^[[:space:]]*[a-z]+/ {
id=$1
held=$2
maxheld=$3
barrier=$4
limit=$5
failcnt=$6
}
(id!="") {
if (barrier == 0)
barrier=limit;
printf "%12s %5s %5.1f%% %5s %5.1f%% %5s\n", id,
hr(id, held), held / barrier * 100,
hr(id, maxheld), maxheld / barrier * 100,
hr(id, failcnt)
id=""
}
'
Example output:
CT: 90162| held | maxheld | fails
kmemsize 4M 4.1% 7M 6.5% 0
lockedpages 0 0.0% 0 0.0% 0
privvmpages 38M 1.9% 461M 22.5% 0
shmpages 2M 0.4% 2M 0.4% 0
numproc 31 1.6% 43 2.2% 0
physpages 21M 0.0% 441M 0.0% 0
vmguarpages 0 0.0% 0 0.0% 0
oomguarpages 21M 0.0% 441M 0.0% 0
numtcpsock 6 0.2% 15 0.5% 0
numflock 5 0.3% 7 0.5% 0
numpty 1 0.8% 1 0.8% 0
numsiginfo 0 0.0% 2 0.2% 0
tcpsndbuf 113K 0.8% 2M 17.3% 0
tcprcvbuf 96K 0.7% 0 0.0% 0
othersockbuf 2K 0.0% 45K 0.5% 0
dgramrcvbuf 0 0.0% 8K 0.4% 0
numothersock 8 0.3% 14 0.5% 0
dcachesize 455K 1.7% 625K 2.3% 0
numfile 2K 2.8% 3K 4.5% 0
numiptent 16 1.6% 16 1.6% 0
|
Категория «Мультипликация»
Взлеты Топ 5
Падения Топ 5
Популярные за сутки
|
Загрузка...
BlogRider.ru не имеет отношения к публикуемым в записях блогов материалам. Все записи
взяты из открытых общедоступных источников и являются собственностью их авторов.
взяты из открытых общедоступных источников и являются собственностью их авторов.
