Class: Blitz::Curl::Sprint::Step
- Inherits:
-
Object
- Object
- Blitz::Curl::Sprint::Step
- Defined in:
- lib/blitz/curl/sprint.rb
Overview
Represents a step in the transaction (even if there’s only one). Each step contains the request and response objects as well as the stats associated with them.
Instance Attribute Summary collapse
-
#connect ⇒ Object
readonly
The time it took for the TCP connection.
-
#duration ⇒ Object
readonly
The time it took for this step (includes the connect, send and receive).
-
#request ⇒ Object
readonly
The request object containing the URL, headers and content, if any.
-
#response ⇒ Object
readonly
The response object containing the status code, headers and content, if any.
Instance Method Summary collapse
-
#initialize(json) ⇒ Step
constructor
:nodoc:.
Constructor Details
#initialize(json) ⇒ Step
:nodoc:
77 78 79 80 81 82 |
# File 'lib/blitz/curl/sprint.rb', line 77 def initialize json # :nodoc: @connect = json['connect'] @duration = json['duration'] @request = Request.new json['request'] if json['request'] @response = Response.new json['response'] if json['response'] end |
Instance Attribute Details
#connect ⇒ Object (readonly)
The time it took for the TCP connection
66 67 68 |
# File 'lib/blitz/curl/sprint.rb', line 66 def connect @connect end |
#duration ⇒ Object (readonly)
The time it took for this step (includes the connect, send and receive)
69 70 71 |
# File 'lib/blitz/curl/sprint.rb', line 69 def duration @duration end |
#request ⇒ Object (readonly)
The request object containing the URL, headers and content, if any
72 73 74 |
# File 'lib/blitz/curl/sprint.rb', line 72 def request @request end |
#response ⇒ Object (readonly)
The response object containing the status code, headers and content, if any
75 76 77 |
# File 'lib/blitz/curl/sprint.rb', line 75 def response @response end |