Connection mixin
Public Class methods
new(*)
[show source]
# File lib/httpx/plugins/tracing.rb 117 def initialize(*) 118 super 119 120 @init_time = nil 121 end
Public Instance methods
idling()
[show source]
# File lib/httpx/plugins/tracing.rb 134 def idling 135 super 136 137 @init_time = nil 138 end
send_request_to_parser(request)
[show source]
# File lib/httpx/plugins/tracing.rb 123 def send_request_to_parser(request) 124 if connecting? && @init_time 125 # at this point, the connection has connected, but hasn't yet transitioned to :open, 126 # so it's the time the requests which caused this connection to connect, are finally being 127 # sent to the parser, so handshake time should factor into the span time. 128 request.handshake_time ||= ::Time.now.utc - @init_time 129 end 130 131 super 132 end
terminate()
[show source]
# File lib/httpx/plugins/tracing.rb 140 def terminate 141 super 142 143 # ensure that connections which go back to the pool reset their init time. 144 @init_time = nil 145 end