2011-07-28 19:09:27 +00:00
|
|
|
### Test niceload -q
|
|
|
|
This works
|
|
|
|
|
2014-07-15 00:40:38 +00:00
|
|
|
echo '### --rm and --runmem'
|
2011-07-20 23:58:23 +00:00
|
|
|
### --rm and --runmem
|
2016-08-21 13:37:59 +00:00
|
|
|
niceload -H --rm 1g free -g | perl -ane '/Mem:/ and print $F[5],"\n"' | grep '[1-9]' >/dev/null && echo OK--rm
|
2012-10-22 21:08:54 +00:00
|
|
|
OK--rm
|
2016-08-21 13:37:59 +00:00
|
|
|
niceload -H --runmem 1g free -g | perl -ane '/Mem:/ and print $F[5],"\n"' | grep '[1-9]' >/dev/null && echo OK--runmem
|
2012-10-22 21:08:54 +00:00
|
|
|
OK--runmem
|
2014-07-15 00:40:38 +00:00
|
|
|
echo '### -N and --noswap. Must give 0'
|
2012-10-22 21:08:54 +00:00
|
|
|
### -N and --noswap. Must give 0
|
2014-07-15 00:40:38 +00:00
|
|
|
niceload -H -N vmstat 1 2 | tail -n1 | awk '{print "-N " $7*$8}'
|
2012-10-22 21:08:54 +00:00
|
|
|
-N 0
|
2014-07-15 00:40:38 +00:00
|
|
|
niceload -H --noswap vmstat 1 2 | tail -n1 | awk '{print "--noswap " $7*$8}'
|
2012-10-22 21:08:54 +00:00
|
|
|
--noswap 0
|
2014-07-15 00:40:38 +00:00
|
|
|
echo '### -H and --hard'
|
2011-07-20 23:58:23 +00:00
|
|
|
### -H and --hard
|
2015-01-08 23:00:21 +00:00
|
|
|
niceload -H -l 9.9 uptime | grep ':.[1-9][0-9].[0-9][0-9],' || echo OK-load below 9.9
|
|
|
|
OK-load below 9.9
|
|
|
|
niceload --hard -l 9 uptime | grep ':.[1-9][0-9].[0-9][0-9],' || echo OK-load below 10
|
|
|
|
OK-load below 10
|
2014-07-15 00:40:38 +00:00
|
|
|
echo '### -f and --factor'
|
2011-07-20 23:58:23 +00:00
|
|
|
### -f and --factor
|
2014-07-15 00:40:38 +00:00
|
|
|
niceload -H -f 0.01 -l6 echo f 0.1 finish first
|
2012-10-22 21:08:54 +00:00
|
|
|
f 0.1 finish first
|
2020-10-14 17:27:31 +00:00
|
|
|
niceload -H --factor 30 -l6 echo factor 30 finish last
|
|
|
|
factor 30 finish last
|