Class: Blitz::Curl::Sprint::Step

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#connectObject (readonly)

The time it took for the TCP connection



66
67
68
# File 'lib/blitz/curl/sprint.rb', line 66

def connect
  @connect
end

#durationObject (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

#requestObject (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

#responseObject (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