X-Git-Url: https://git.openstreetmap.org/chef.git/blobdiff_plain/b20599b6503be65674c3e420be6cca91b507ac0a..ff044920428608b2c04507ad52d6ab52c9d6555f:/cookbooks/munin/files/default/plugins/api_calls_ diff --git a/cookbooks/munin/files/default/plugins/api_calls_ b/cookbooks/munin/files/default/plugins/api_calls_ index 179c07fb5..8cf836d79 100755 --- a/cookbooks/munin/files/default/plugins/api_calls_ +++ b/cookbooks/munin/files/default/plugins/api_calls_ @@ -5,7 +5,7 @@ require 'date' require 'hpricot' require 'open-uri' -def uris_from_status(server) +def uris_from_status(server) file = open("http://#{server}/server-status").read doc = Hpricot.parse(file) tables = doc / 'table' @@ -18,19 +18,19 @@ def uris_from_status(server) end CALL_TYPES = { - :map => "Map API calls", - :upload => "Changeset diff uploads", - :amf => "AMF API calls", - :history => "Element history fetches", + :map => "Map API calls", + :upload => "Changeset diff uploads", + :amf => "AMF API calls", + :history => "Element history fetches", :full => "Full element fetches", :trkpts => "GPX trackpoints calls", - :web => "Web site traffic", + :web => "Web site traffic", :other => "Other API calls" } def categorise_uri(line) uri = line.split(" ")[1] - + case uri when /api\/0\.6\/map/ then :map when /api\/0\.6\/changeset\/[0-9]*\/upload/ then :upload @@ -62,7 +62,7 @@ else end h end - + CALL_TYPES.keys.each do |type| count = counts[type] || 0 puts "#{type}.value #{count}"