Module: HTTPX::Plugins::InternalTelemetry::PoolMethods

Defined in:
lib/httpx/plugins/internal_telemetry.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(klass) ⇒ Object



135
136
137
138
139
# File 'lib/httpx/plugins/internal_telemetry.rb', line 135

def self.included(klass)
  klass.prepend Loggable
  klass.prepend TrackTimeMethods
  super
end

Instance Method Details

#checkin_connection(connection) ⇒ Object



147
148
149
150
151
# File 'lib/httpx/plugins/internal_telemetry.rb', line 147

def checkin_connection(connection)
  super.tap do
    meter_elapsed_time("Pool##{object_id}: checked in connection for Connection##{connection.object_id}[#{connection.origin}]}")
  end
end

#checkout_connection(request_uri, options) ⇒ Object



141
142
143
144
145
# File 'lib/httpx/plugins/internal_telemetry.rb', line 141

def checkout_connection(request_uri, options)
  super.tap do |connection|
    meter_elapsed_time("Pool##{object_id}: checked out connection for Connection##{connection.object_id}[#{connection.origin}]}")
  end
end