2012-12-10 20:57:00 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2024-01-24 01:02:07 +00:00
|
|
|
# SPDX-FileCopyrightText: 2021-2024 Ole Tange, http://ole.tange.dk and Free Software and Foundation, Inc.
|
2021-03-22 20:16:35 +00:00
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
2014-11-13 15:57:41 +00:00
|
|
|
cp /bin/sleep /tmp/mysleep
|
|
|
|
killall -9 mysleep 2>/dev/null
|
|
|
|
|
2012-12-10 20:57:00 +00:00
|
|
|
# force load > 10
|
2017-06-22 11:35:58 +00:00
|
|
|
while uptime | grep -v age:.[1-9][0-9].[0-9][0-9] >/dev/null ; do
|
|
|
|
(timeout 5 nice perl -e 'while(1){}' 2>/dev/null &)
|
|
|
|
done
|
2012-12-10 20:57:00 +00:00
|
|
|
|
2012-12-10 22:16:25 +00:00
|
|
|
sleep 2 &
|
|
|
|
export PID1=$!
|
|
|
|
sleep 2 &
|
|
|
|
export PID2=$!
|
|
|
|
sleep 2 &
|
|
|
|
export PID3=$!
|
|
|
|
echo '### multiple -p'
|
2022-04-23 09:38:57 +00:00
|
|
|
stdout /usr/bin/time -f %e niceload -l 9 -H -p $PID1 -p $PID2 -p $PID3 |
|
|
|
|
perl -ne '$_ > 5 and print "Multiple -p OK\n"' &
|
2012-12-10 22:16:25 +00:00
|
|
|
|
2016-05-17 00:11:38 +00:00
|
|
|
/tmp/mysleep 4 &
|
|
|
|
/tmp/mysleep 4 &
|
|
|
|
/tmp/mysleep 4 &
|
2012-12-10 22:16:25 +00:00
|
|
|
echo '### --prg'
|
2022-04-23 09:38:57 +00:00
|
|
|
stdout /usr/bin/time -f %e niceload -l 8 -H --prg /tmp/mysleep |
|
|
|
|
perl -ne '$_ > 8 and print "--prg OK\n"'
|
2015-02-01 13:38:26 +00:00
|
|
|
rm /tmp/mysleep
|