Class: Clownfish::ResponseTimes

Inherits:
Object
  • Object
show all
Defined in:
lib/clownfish/fish/response_times.rb

Overview

Clownfish that records the response time of every url.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeResponseTimes

Returns a new instance of ResponseTimes.



7
8
9
# File 'lib/clownfish/fish/response_times.rb', line 7

def initialize
  @times_by_url = {}
end

Instance Attribute Details

#times_by_urlObject (readonly)

Hash where key is url String and value is number (milliseconds).



5
6
7
# File 'lib/clownfish/fish/response_times.rb', line 5

def times_by_url
  @times_by_url
end

Instance Method Details

#anemone_optionsObject



11
12
13
14
# File 'lib/clownfish/fish/response_times.rb', line 11

def anemone_options
  # Not looking at page bodies so don't keep them around
  {:discard_page_bodies => true}
end

#on_every_page(page) ⇒ Object



16
17
18
# File 'lib/clownfish/fish/response_times.rb', line 16

def on_every_page(page)
  @times_by_url[page.url.to_s] = page.response_time
end