Class: Clownfish::ResponseTimes
- Inherits:
-
Object
- Object
- Clownfish::ResponseTimes
- Defined in:
- lib/clownfish/fish/response_times.rb
Overview
Clownfish that records the response time of every url.
Instance Attribute Summary collapse
-
#times_by_url ⇒ Object
readonly
Hash where key is url String and value is number (milliseconds).
Instance Method Summary collapse
- #anemone_options ⇒ Object
-
#initialize ⇒ ResponseTimes
constructor
A new instance of ResponseTimes.
- #on_every_page(page) ⇒ Object
Constructor Details
#initialize ⇒ ResponseTimes
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_url ⇒ Object (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_options ⇒ Object
11 12 13 14 |
# File 'lib/clownfish/fish/response_times.rb', line 11 def # 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 |