class Pingdom::Summary::Performance
summary.performance includeuptime resolution=day {“days”=>[{“unmonitored”=>0, “downtime”=>0, “starttime”=>1297238400, “uptime”=>86400, “avgresponse”=>234},
{"unmonitored"=>0, "downtime"=>0, "starttime"=>1297324800, "uptime"=>86400, "avgresponse"=>215}, {"unmonitored"=>0, "downtime"=>2648, "starttime"=>1297411200, "uptime"=>83752, "avgresponse"=>211}, {"unmonitored"=>0, "downtime"=>0, "starttime"=>1297497600, "uptime"=>86400, "avgresponse"=>207}, {"unmonitored"=>0, "downtime"=>330, "starttime"=>1297584000, "uptime"=>86070, "avgresponse"=>228}, {"unmonitored"=>0, "downtime"=>0, "starttime"=>1297670400, "uptime"=>86400, "avgresponse"=>236}, {"unmonitored"=>0, "downtime"=>0, "starttime"=>1297756800, "uptime"=>86400, "avgresponse"=>230}, {"unmonitored"=>0, "downtime"=>0, "starttime"=>1297843200, "uptime"=>86400, "avgresponse"=>256}, {"unmonitored"=>0, "downtime"=>0, "starttime"=>1297929600, "uptime"=>86400, "avgresponse"=>216}, {"unmonitored"=>0, "downtime"=>0, "starttime"=>1298016000, "uptime"=>86400, "avgresponse"=>251}, {"unmonitored"=>0, "downtime"=>0, "starttime"=>1298102400, "uptime"=>8646, "avgresponse"=>223}]}
Constants
- INTERVALS
Public Class Methods
parse(client, response)
click to toggle source
Calls superclass method
Pingdom::Base::parse
# File lib/pingdom/summary/performance.rb, line 23 def self.parse(client, response) body = super[:summary] interval = body.keys.detect{ |k| INTERVALS.keys.include?(k.chomp('s').to_s) }.chomp('s').to_sym intervals = body[interval.to_s.pluralize] intervals.map do |perf| perf[:interval] = interval new(client, response, perf) end end
Public Instance Methods
downtime()
click to toggle source
# File lib/pingdom/summary/performance.rb, line 47 def downtime @attributes[:downtime].seconds end
endtime()
click to toggle source
# File lib/pingdom/summary/performance.rb, line 39 def endtime starttime + INTERVALS[interval.to_s].to_i end
Also aliased as: end_at
monitored()
click to toggle source
# File lib/pingdom/summary/performance.rb, line 53 def monitored uptime + downtime end
period()
click to toggle source
# File lib/pingdom/summary/performance.rb, line 56 def period monitored + unmonitored end
starttime()
click to toggle source
# File lib/pingdom/summary/performance.rb, line 34 def starttime Time.at(@attributes[:starttime]) end
Also aliased as: start_at
unmonitored()
click to toggle source
# File lib/pingdom/summary/performance.rb, line 50 def unmonitored @attributes[:unmonitored].seconds end
uptime()
click to toggle source
# File lib/pingdom/summary/performance.rb, line 44 def uptime @attributes[:uptime].seconds end