class Pingdom::TMSSummary::Performance

summary.performance includeuptime resolution=day {“days”=>[

{
  "#"=>[
    {"avgresponse"=>994,"command"=>"Go to URL http://google.com"},
    {"avgresponse"=>6,"command"=>"URL should be http://google.com"}
  ],
  "avgresponse"=>1000,"downtime"=>0,"starttime"=>1500000000,"unmonitored"=>0,
  "uptime"=>86400,"revision"=>12345
}

]}

Constants

INTERVALS

Public Class Methods

parse(client, response) click to toggle source
Calls superclass method Pingdom::Base::parse
# File lib/pingdom/tms_summary/performance.rb, line 29
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/tms_summary/performance.rb, line 59
def downtime
  @attributes["downtime"].seconds
end
end_at()
Alias for: endtime
endtime() click to toggle source
# File lib/pingdom/tms_summary/performance.rb, line 50
def endtime
  starttime + INTERVALS[interval.to_s].to_i
end
Also aliased as: end_at
ingredients() click to toggle source
# File lib/pingdom/tms_summary/performance.rb, line 40
def ingredients
  @attributes["#"].map { |ingredient| Ingredient.new @client, ingredient }
end
Also aliased as: per_ingredient
monitored() click to toggle source
# File lib/pingdom/tms_summary/performance.rb, line 67
def monitored
  uptime + downtime
end
per_ingredient()
Alias for: ingredients
period() click to toggle source
# File lib/pingdom/tms_summary/performance.rb, line 71
def period
  monitored + unmonitored
end
start_at()
Alias for: starttime
starttime() click to toggle source
# File lib/pingdom/tms_summary/performance.rb, line 45
def starttime
  Time.at(@attributes["starttime"])
end
Also aliased as: start_at
unmonitored() click to toggle source
# File lib/pingdom/tms_summary/performance.rb, line 63
def unmonitored
  @attributes["unmonitored"].seconds
end
uptime() click to toggle source
# File lib/pingdom/tms_summary/performance.rb, line 55
def uptime
  @attributes["uptime"].seconds
end