]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/munin/files/default/plugins/api_calls_num
Merge remote-tracking branch 'tigerfell/pr257'
[chef.git] / cookbooks / munin / files / default / plugins / api_calls_num
index 7c8ccabccb10cb4bb0876ed0fe3e81cfc29337ef..e776505d23926ac80a3e5288500fe25f13b376bb 100755 (executable)
@@ -11,7 +11,7 @@ CALL_TYPES = {
   :trkpts => "GPX trackpoints calls",
   :web => "Web site traffic",
   :other => "Other API calls"
-}
+}.freeze
 
 if ARGV[0] == "config"
   puts "graph_title Requests processed"
@@ -22,11 +22,12 @@ if ARGV[0] == "config"
   CALL_TYPES.each do |type, label|
     puts "#{type}.label #{label}"
     puts "#{type}.type DERIVE"
+    puts "#{type}.min 0"
   end
 else
   statistics = JSON.parse(File.read("/srv/www.openstreetmap.org/rails/tmp/statistics.json"))
 
-  CALL_TYPES.keys.each do |type|
+  CALL_TYPES.each_key do |type|
     count = statistics["uri"][type.to_s] || 0
     puts "#{type}.value #{count}"
   end