7   "206" => "Partial Content",
 
   8   "301" => "Moved Permanently",
 
  11   "304" => "Not Modified",
 
  12   "400" => "Bad Request",
 
  13   "401" => "Unauthorized",
 
  16   "405" => "Method Not Allowed",
 
  17   "408" => "Request Timeout",
 
  20   "412" => "Precondition Failed",
 
  21   "416" => "Requested Range Not Satisfiable",
 
  22   "422" => "Unprocessable Entity",
 
  23   "500" => "Internal Server Error",
 
  24   "502" => "Bad Gateway",
 
  25   "503" => "Service Unavailable",
 
  26   "509" => "Bandwidth Limit Exceeded"
 
  29 if ARGV[0] == "config"
 
  30   puts "graph_title HTTP response codes"
 
  31   puts "graph_args --base 1000"
 
  32   puts "graph_vlabel Number of requests per ${graph_period}"
 
  33   puts "graph_category api"
 
  35   HTTP_STATUSES.each do |code, label|
 
  36     puts "http#{code}.label #{code} #{label}"
 
  37     puts "http#{code}.type DERIVE"
 
  38     puts "http#{code}.min 0"
 
  41   statistics = JSON.parse(File.read("/srv/www.openstreetmap.org/rails/tmp/statistics.json"))
 
  43   HTTP_STATUSES.each_key do |code|
 
  44     count = statistics["status"][code] || 0
 
  45     puts "http#{code}.value #{count}"