Révision f7cce858
Add job stats graph
| plugins/sge/sge_job_stats | ||
|---|---|---|
| 1 |
#!/bin/bash |
|
| 2 |
|
|
| 3 |
# Graphs the number of running and waiting jobs, as well as when they |
|
| 4 |
# are submitted. |
|
| 5 |
# |
|
| 6 |
# Tested with Son of Gridengine. |
|
| 7 |
|
|
| 8 |
if [ "$1" = "config" ] |
|
| 9 |
then |
|
| 10 |
echo graph_title SGE gridengine jobs |
|
| 11 |
echo graph_vlabel count |
|
| 12 |
echo graph_category processes |
|
| 13 |
echo running.label Running jobs |
|
| 14 |
echo running.type GAUGE |
|
| 15 |
echo running.draw AREA |
|
| 16 |
echo waiting.label Queued jobs |
|
| 17 |
echo waiting.type GAUGE |
|
| 18 |
echo waiting.draw STACK |
|
| 19 |
echo maxnum.label Submitted jobs |
|
| 20 |
echo maxnum.type DERIVE |
|
| 21 |
echo maxnum.draw LINE2 |
|
| 22 |
echo maxnum.min 0 |
|
| 23 |
|
|
| 24 |
exit 0 |
|
| 25 |
fi |
|
| 26 |
|
|
| 27 |
. /opt/sge/default/common/settings.sh |
|
| 28 |
|
|
| 29 |
qstat -u '*' | awk ' |
|
| 30 |
BEGIN{maxnum = 0; running = 0; waiting = 0}
|
|
| 31 |
/^ /{
|
|
| 32 |
maxnum = (maxnum > $1 ? maxnum : $1); |
|
| 33 |
if ( $5 == "r" ) {
|
|
| 34 |
running += 1; |
|
| 35 |
} else {
|
|
| 36 |
waiting += 1; |
|
| 37 |
} |
|
| 38 |
} |
|
| 39 |
END { printf("running.value %d\nwaiting.value %d\nmaxnum.value %d\n", running, waiting, maxnum); }'
|
|
Formats disponibles : Unified diff