Class: WBench::Results
- Inherits:
-
Object
- Object
- WBench::Results
- Defined in:
- lib/wbench/results.rb
Instance Attribute Summary collapse
-
#app_server ⇒ Object
Returns the value of attribute app_server.
-
#browser ⇒ Object
Returns the value of attribute browser.
-
#latency ⇒ Object
Returns the value of attribute latency.
-
#loops ⇒ Object
Returns the value of attribute loops.
-
#time ⇒ Object
Returns the value of attribute time.
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
- #add(app_server, browser, latency) ⇒ Object
-
#initialize(url, loops) ⇒ Results
constructor
A new instance of Results.
- #to_s ⇒ Object
Constructor Details
#initialize(url, loops) ⇒ Results
Returns a new instance of Results.
5 6 7 8 9 10 11 12 |
# File 'lib/wbench/results.rb', line 5 def initialize(url, loops) @url = url @loops = loops @time = Time.now.asctime @browser = {} @latency = {} @app_server = [] end |
Instance Attribute Details
#app_server ⇒ Object
Returns the value of attribute app_server.
3 4 5 |
# File 'lib/wbench/results.rb', line 3 def app_server @app_server end |
#browser ⇒ Object
Returns the value of attribute browser.
3 4 5 |
# File 'lib/wbench/results.rb', line 3 def browser @browser end |
#latency ⇒ Object
Returns the value of attribute latency.
3 4 5 |
# File 'lib/wbench/results.rb', line 3 def latency @latency end |
#loops ⇒ Object
Returns the value of attribute loops.
3 4 5 |
# File 'lib/wbench/results.rb', line 3 def loops @loops end |
#time ⇒ Object
Returns the value of attribute time.
3 4 5 |
# File 'lib/wbench/results.rb', line 3 def time @time end |
#url ⇒ Object
Returns the value of attribute url.
3 4 5 |
# File 'lib/wbench/results.rb', line 3 def url @url end |
Instance Method Details
#add(app_server, browser, latency) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/wbench/results.rb', line 14 def add(app_server, browser, latency) browser.each do |key, value| @browser[key] ||= [] @browser[key] << value end latency.each do |key, value| @latency[key] ||= [] @latency[key] << value end @app_server << app_server end |
#to_s ⇒ Object
28 29 30 |
# File 'lib/wbench/results.rb', line 28 def to_s ResultsFormatter.new(self).to_s end |