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