]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/munin/files/default/plugins/api_waits_
Remove trailing whitespace in ruby code
[chef.git] / cookbooks / munin / files / default / plugins / api_waits_
index 029c9f4a6d701abadd2ff11cd7ffffbcd0dde158..741f190f0f38123e575af404764f5063032a692d 100755 (executable)
@@ -5,7 +5,7 @@ require 'date'
 require 'hpricot'
 require 'open-uri'
 
 require 'hpricot'
 require 'open-uri'
 
-def uri_and_times_from_status(server) 
+def uri_and_times_from_status(server)
   file = open("http://#{server}/server-status").read
   doc = Hpricot.parse(file)
   tables = doc / 'table'
   file = open("http://#{server}/server-status").read
   doc = Hpricot.parse(file)
   tables = doc / 'table'
@@ -18,19 +18,19 @@ def uri_and_times_from_status(server)
 end
 
 CALL_TYPES = {
 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",
   :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]
   :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
   case uri
   when /api\/0\.6\/map/ then :map
   when /api\/0\.6\/changeset\/[0-9]*\/upload/ then :upload
@@ -63,7 +63,7 @@ else
     end
     h
   end
     end
     h
   end
-  
+
   CALL_TYPES.keys.each do |type|
     count = counts[type] || [0]
     avg = count.inject(0){|x,y|x+y} / (1.0 * count.length)
   CALL_TYPES.keys.each do |type|
     count = counts[type] || [0]
     avg = count.inject(0){|x,y|x+y} / (1.0 * count.length)