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



116
117
118
119
# File 'lib/httpx/plugins/internal_telemetry.rb', line 116

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

Instance Method Details

#checkin_connection(connection) ⇒ Object



127
128
129
130
131
# File 'lib/httpx/plugins/internal_telemetry.rb', line 127

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



121
122
123
124
125
# File 'lib/httpx/plugins/internal_telemetry.rb', line 121

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