Files
openstreetmap-mod_tile-pyth…/utils/munin/renderd_queue
Hummeltech 3612c5f207 Allow overriding Munin script URLs with an environment variable (#420)
* Also allow overriding `RENDERD_STATS` (defaults to `/run/renderd/renderd.stats`)
* Also allow overriding `REPLICATION_STATE` (defaults to `/home/osm/replicate/state.txt`)
2024-06-25 18:27:05 -07:00

60 lines
2.2 KiB
Bash
Executable File

#!/bin/sh
#
# Plugin to monitor queue length of tiles submited for rendering in renderd
#
# Parameters:
#
# config (required)
# autoconf (optional - used by munin-config)
#
# Copyright (c) 2007 - 2023 by mod_tile contributors (see AUTHORS file)
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; If not, see http://www.gnu.org/licenses/.
if [ "$1" = "config" ]; then
echo 'graph_title Renderd queue length'
echo 'graph_args --base 1000 -l 0'
echo 'graph_vlabel metatiles'
echo 'graph_category renderd'
echo 'reqPrio.label Priority request Queue'
echo 'reqPrio.type GAUGE'
echo 'reqPrio.max 100'
echo 'req.label Request Queue'
echo 'req.type GAUGE'
echo 'req.max 100'
echo 'reqLow.label Low priority request Queue'
echo 'reqLow.type GAUGE'
echo 'reqLow.max 100'
echo 'dirty.label Dirty Queue'
echo 'dirty.type GAUGE'
echo 'dirty.max 1000'
echo 'reqBulk.label Bulk request Queue'
echo 'reqBulk.type GAUGE'
echo 'reqBulk.max 100'
exit 0
fi
reqlength=$(sed -e '/^ReqQueueLength/!d' -e 's/.*: //' -e q ${RENDERD_STATS:-/run/renderd/renderd.stats})
reqpriolength=$(sed -e '/^ReqPrioQueueLength/!d' -e 's/.*: //' -e q ${RENDERD_STATS:-/run/renderd/renderd.stats})
reqpriolowlength=$(sed -e '/^ReqLowQueueLength/!d' -e 's/.*: //' -e q ${RENDERD_STATS:-/run/renderd/renderd.stats})
reqbulklength=$(sed -e '/^ReqBulkQueueLength/!d' -e 's/.*: //' -e q ${RENDERD_STATS:-/run/renderd/renderd.stats})
dirtlength=$(sed -e '/^DirtQueueLength/!d' -e 's/.*: //' -e q ${RENDERD_STATS:-/run/renderd/renderd.stats})
echo "reqPrio.value " $reqpriolength
echo "req.value " $reqlength
echo "reqLow.value " $reqpriolowlength
echo "dirty.value " $dirtlength
echo "reqBulk.value " $reqbulklength