]> git.openstreetmap.org Git - chef.git/blob - cookbooks/overpass/templates/default/munin_request_count.erb
donate: redirect to support.osm.org
[chef.git] / cookbooks / overpass / templates / default / munin_request_count.erb
1 #!/usr/bin/env bash
2 #
3 # DO NOT EDIT - This file is being maintained by Chef
4 #
5 # Based on: https://github.com/drolbr/Overpass-API/blob/way_based_areas/munin/osm_db_request_count
6
7 if [[ "$1" = "config" ]]; then
8 {
9   echo 'graph_title API request count'
10   echo 'graph_vlabel per minute'
11   echo 'graph_category overpass'
12   echo "overpass_request_started.label Base started"
13   echo "overpass_request_started.type COUNTER"
14   echo "overpass_request_started.cdef overpass_request_started,60,*"
15   echo "overpass_request_started.max 10000"
16   echo "overpass_request_completed.label Base completed"
17   echo "overpass_request_completed.type COUNTER"
18   echo "overpass_request_completed.cdef overpass_request_completed,60,*"
19   echo "overpass_request_completed.max 10000"
20   echo "overpass_area_request_started.label Area started"
21   echo "overpass_area_request_started.type COUNTER"
22   echo "overpass_area_request_started.cdef overpass_area_request_started,60,*"
23   echo "overpass_area_request_started.max 10000"
24   echo "overpass_area_request_completed.label Area completed"
25   echo "overpass_area_request_completed.type COUNTER"
26   echo "overpass_area_request_completed.cdef overpass_area_request_completed,60,*"
27   echo "overpass_area_request_completed.max 10000"
28   exit 0
29 }; fi
30
31 BASE_STATUS=`<%= @basedir %>/bin/dispatcher --osm-base --status | tr '\n' '|'`
32 AREA_STATUS=`<%= @basedir %>/bin/dispatcher --areas --status | tr '\n' '|'`
33
34 STARTED=`echo $BASE_STATUS | sed 's,.*Counter of started requests:,,;s:|.*::'`
35 echo "overpass_request_started.value $STARTED"
36
37 COMPLETED=`echo $BASE_STATUS | sed 's,.*Counter of finished requests:,,;s:|.*::'`
38 echo "overpass_request_completed.value $COMPLETED"
39
40 STARTED=`echo $AREA_STATUS | sed 's,.*Counter of started requests:,,;s:|.*::'`
41 echo "overpass_area_request_started.value $STARTED"
42
43 COMPLETED=`echo $AREA_STATUS | sed 's,.*Counter of finished requests:,,;s:|.*::'`
44 echo "overpass_area_request_completed.value $COMPLETED"