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 "500" => "Internal Server Error",
23 "502" => "Bad Gateway",
24 "503" => "Service Unavailable",
25 "509" => "Bandwidth Limit Exceeded"
28 if ARGV[0] == "config"
29 puts "graph_title HTTP response codes"
30 puts "graph_args --base 1000"
31 puts "graph_vlabel Number of requests per ${graph_period}"
32 puts "graph_category api"
34 HTTP_STATUSES.each do |code, label|
35 puts "http#{code}.label #{code} #{label}"
36 puts "http#{code}.type DERIVE"
37 puts "http#{code}.min 0"
40 statistics = JSON.parse(File.read("/srv/www.openstreetmap.org/rails/tmp/statistics.json"))
42 HTTP_STATUSES.keys.each do |code|
43 count = statistics["status"][code] || 0
44 puts "http#{code}.value #{count}"