3 # Plugin to monitor the types of requsts made to the API
8 # autoconf (optional - used by munin-config)
11 if [ "$1" = "config" ]; then
13 echo 'graph_title Requests by API call'
14 echo 'graph_args --base 1000 -l 0'
15 echo 'graph_vlabel requests per minute'
16 echo 'graph_category nominatim'
17 echo 'z1.label reverse'
20 echo 'z2.label search (successful)'
23 echo 'z3.label search (no result)'
26 echo 'z4.label details'
33 query="select count(*)/5.0 from new_query_log where starttime > (now() - interval '5 min') and "
35 reverse=`psql -d nominatim -c "copy ($query type='reverse') to stdout"`
36 searchy=`psql -d nominatim -c "copy ($query type='search' and results>0) to stdout"`
37 searchn=`psql -d nominatim -c "copy ($query type='search' and results=0) to stdout"`
38 details=`psql -d nominatim -c "copy ($query type='details') to stdout"`
40 echo "z1.value $reverse"
41 echo "z2.value $searchy"
42 echo "z3.value $searchn"
43 echo "z4.value $details"