Révision 67f97837
Plugins jstat__*: fix shellcheck issues; switch from bash to sh
| plugins/jvm/jstat__gccount | ||
|---|---|---|
| 1 |
#!/bin/bash
|
|
| 1 |
#!/bin/sh |
|
| 2 | 2 |
# |
| 3 | 3 |
# Plugin for monitor JVM activity - GC Count - |
| 4 | 4 |
# |
| ... | ... | |
| 64 | 64 |
|
| 65 | 65 |
|
| 66 | 66 |
print_config() {
|
| 67 |
echo 'graph_title GC Count' $graphtitle
|
|
| 67 |
echo "graph_title GC Count $graphtitle"
|
|
| 68 | 68 |
echo 'graph_args -l 0' |
| 69 | 69 |
echo 'graph_vlabel GC Count(times)' |
| 70 | 70 |
echo 'graph_total total' |
| ... | ... | |
| 73 | 73 |
|
| 74 | 74 |
echo 'Young_GC.label Young_GC' |
| 75 | 75 |
echo 'Young_GC.min 0' |
| 76 |
if [ "${JDK_TYPE}" == "bea" ]; then
|
|
| 76 |
if [ "${JDK_TYPE}" = "bea" ]; then
|
|
| 77 | 77 |
echo 'Old_GC.label Old_GC' |
| 78 | 78 |
echo 'Old_GC.min 0' |
| 79 | 79 |
else |
| ... | ... | |
| 86 | 86 |
print_stats() {
|
| 87 | 87 |
local pid_num="$1" |
| 88 | 88 |
local awk_script |
| 89 |
if [ "${JDK_TYPE}" == "bea" ]; then
|
|
| 89 |
if [ "${JDK_TYPE}" = "bea" ]; then
|
|
| 90 | 90 |
# shellcheck disable=SC2016 |
| 91 | 91 |
awk_script='{ YC = $4; OC = $5; print "Young_GC.value " YGC; print "Old_GC.value " FGC; }'
|
| 92 | 92 |
elif [ "${JDK_TYPE}" = "sun15" ]; then
|
| ... | ... | |
| 110 | 110 |
exit 1 |
| 111 | 111 |
fi |
| 112 | 112 |
|
| 113 |
if [ ! -f "${pidfilepath}" -o ! -r "${pidfilepath}" ]; then
|
|
| 113 |
if [ ! -f "${pidfilepath}" ] || [ ! -r "${pidfilepath}" ]; then
|
|
| 114 | 114 |
echo "no (No such file ${pidfilepath} or cannot read ${pidfilepath}"
|
| 115 | 115 |
exit 1 |
| 116 | 116 |
fi |
Formats disponibles : Unified diff