]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/munin/files/default/plugins/api_calls_num
Standardise on double quoted strings
[chef.git] / cookbooks / munin / files / default / plugins / api_calls_num
index b1d45422845e37eee924aa028819403d79baac3c..fbc64f387df3ce29bfcf43d94cb7e57a8f4a4efc 100755 (executable)
@@ -1,9 +1,9 @@
 #!/usr/bin/ruby
 
-require 'rubygems'
-require 'date'
-gem 'home_run', '>= 0'
-require 'apache_log_regex'
+require "rubygems"
+require "date"
+gem "home_run", ">= 0"
+require "apache_log_regex"
 
 NUM_LINES = 10000
 
@@ -53,7 +53,7 @@ def categorise_uri(line)
   end
 end
 
-if ARGV[0] == 'config'
+if ARGV[0] == "config"
   puts "graph_title Requests processed"
   puts "graph_vlabel Number of requests per minute"
   puts "graph_category api"
@@ -64,7 +64,7 @@ else
   delta_t = (max_time - min_time).to_f * 24 * 60
   counts = lines
            .collect { |x| categorise_uri(x) }
-           .each_with_object(Hash.new) do |h, e|
+           .each_with_object({}) do |h, e|
     if h.key? e
       h[e] += 1
     else