| 1 |
#!/bin/sh |
| 2 |
# |
| 3 |
# Plugin to monitor queue time spent rendering per queue by renderd |
| 4 |
# |
| 5 |
# Parameters: |
| 6 |
# |
| 7 |
# config (required) |
| 8 |
# autoconf (optional - used by munin-config) |
| 9 |
# |
| 10 |
# Copyright (c) 2007 - 2023 by mod_tile contributors (see AUTHORS file) |
| 11 |
# |
| 12 |
# This program is free software; you can redistribute it and/or |
| 13 |
# modify it under the terms of the GNU General Public License |
| 14 |
# as published by the Free Software Foundation; either version 2 |
| 15 |
# of the License, or (at your option) any later version. |
| 16 |
# |
| 17 |
# This program is distributed in the hope that it will be useful, |
| 18 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 19 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 20 |
# GNU General Public License for more details. |
| 21 |
# |
| 22 |
# You should have received a copy of the GNU General Public License |
| 23 |
# along with this program; If not, see http://www.gnu.org/licenses/. |
| 24 |
|
| 25 |
if [ "$1" = "config" ]; then |
| 26 |
|
| 27 |
echo 'graph_title Renderd time spent by queue' |
| 28 |
echo 'graph_args --base 1000 -l 0' |
| 29 |
echo 'graph_vlabel time spent per ${graph_period}' |
| 30 |
echo 'graph_category renderd' |
| 31 |
echo 'reqPrio.label Priority request queue' |
| 32 |
echo 'reqPrio.type DERIVE' |
| 33 |
echo 'reqPrio.cdef reqPrio,1000,/' |
| 34 |
echo 'reqPrio.min 0' |
| 35 |
echo 'reqPrio.draw AREA' |
| 36 |
echo 'reqPrio.info Time for priority request queue' |
| 37 |
echo 'req.label Request queue' |
| 38 |
echo 'req.type DERIVE' |
| 39 |
echo 'req.cdef req,1000,/' |
| 40 |
echo 'req.min 0' |
| 41 |
echo 'req.draw STACK' |
| 42 |
echo 'req.info Time for Request queue' |
| 43 |
echo 'reqLow.label Low priority request queue' |
| 44 |
echo 'reqLow.type DERIVE' |
| 45 |
echo 'reqLow.cdef reqLow,1000,/' |
| 46 |
echo 'reqLow.min 0' |
| 47 |
echo 'reqLow.draw STACK' |
| 48 |
echo 'reqLow.info Time for low priority request queue' |
| 49 |
echo 'dirty.label Dirty queue' |
| 50 |
echo 'dirty.type DERIVE' |
| 51 |
echo 'dirty.cdef dirty,1000,/' |
| 52 |
echo 'dirty.min 0' |
| 53 |
echo 'dirty.draw STACK' |
| 54 |
echo 'dirty.info Time for dirty queue' |
| 55 |
echo 'reqBulk.label Bulk queue' |
| 56 |
echo 'reqBulk.type DERIVE' |
| 57 |
echo 'reqBulk.cdef reqBulk,1000,/' |
| 58 |
echo 'reqBulk.min 0' |
| 59 |
echo 'reqBulk.draw STACK' |
| 60 |
echo 'reqBulk.info Time for bulk queue' |
| 61 |
exit 0 |
| 62 |
fi |
| 63 |
|
| 64 |
reqTime=$(sed -e '/^TimeRendered/!d' -e 's/.*: //' -e q ${RENDERD_STATS:-/run/renderd/renderd.stats}) |
| 65 |
reqprioTime=$(sed -e '/^TimePrioRendered/!d' -e 's/.*: //' -e q ${RENDERD_STATS:-/run/renderd/renderd.stats}) |
| 66 |
reqpriolowTime=$(sed -e '/^TimeLowRendered/!d' -e 's/.*: //' -e q ${RENDERD_STATS:-/run/renderd/renderd.stats}) |
| 67 |
reqbulkTime=$(sed -e '/^TimeBulkRendered/!d' -e 's/.*: //' -e q ${RENDERD_STATS:-/run/renderd/renderd.stats}) |
| 68 |
dirtyTime=$(sed -e '/^TimeDirtyRendered/!d' -e 's/.*: //' -e q ${RENDERD_STATS:-/run/renderd/renderd.stats}) |
| 69 |
|
| 70 |
echo "req.value " $reqTime |
| 71 |
echo "reqLow.value " $reqpriolowTime |
| 72 |
echo "reqPrio.value " $reqprioTime |
| 73 |
echo "dirty.value " $dirtyTime |
| 74 |
echo "reqBulk.value " $reqbulkTime |