Skip to content

Commit 12684de

Browse files
committed
update show-busy-java-threads.sh
1 parent d68dfc5 commit 12684de

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

show-busy-java-threads.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22
# @Function
3-
# Find the High cpu consume thread of java, and print the stack of these threads.
3+
# Find out the highest cpu consumed threads of java, and print the stack of these threads.
44
#
55
# @Usage
66
# $ ./show-busy-java-threads.sh
@@ -10,18 +10,18 @@
1010
PROG=`basename $0`
1111

1212
redEcho() {
13-
if [ -p /dev/stdout ] ; then
14-
# if stdout is pipeline, shutdown color output.
15-
echo "$@"
16-
else
13+
if [ -c /dev/stdout ] ; then
14+
# if stdout is console, turn on color output.
1715
echo -e "\033[1;31m$@\033[0m"
16+
else
17+
echo "$@"
1818
fi
1919
}
2020

2121
usage() {
2222
cat <<EOF
2323
Usage: ${PROG} [OPTION]...
24-
Find the High cpu consume thread of java, and print the stack of these threads.
24+
Find out the highest cpu consumed threads of java, and print the stack of these threads.
2525
Example: ${PROG} -c 10
2626
2727
Options:

0 commit comments

Comments
 (0)