Class: Aws::Plugins::ClientMetricsSendPlugin::AttemptHandler Private
- Inherits:
-
Seahorse::Client::Handler
- Object
- Seahorse::Client::Handler
- Aws::Plugins::ClientMetricsSendPlugin::AttemptHandler
- Defined in:
- lib/aws-sdk-core/plugins/client_metrics_send_plugin.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Attribute Summary
Attributes inherited from Seahorse::Client::Handler
Instance Method Summary collapse
- #call(context) ⇒ Object private
Methods inherited from Seahorse::Client::Handler
Constructor Details
This class inherits a constructor from Seahorse::Client::Handler
Instance Method Details
#call(context) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/aws-sdk-core/plugins/client_metrics_send_plugin.rb', line 33 def call(context) request_metrics = context.[:client_metrics] attempt_opts = { timestamp: DateTime.now.strftime('%Q').to_i, fqdn: context.http_request.endpoint.host, region: context.config.region, user_agent: context.http_request.headers["user-agent"], } # It will generally cause an error, but it is semantically valid for # credentials to not exist. if context.config.credentials attempt_opts[:access_key] = context.config.credentials.credentials.access_key_id attempt_opts[:session_token] = context.config.credentials.credentials.session_token end call_attempt = request_metrics.build_call_attempt(attempt_opts) context.[:current_call_attempt] = call_attempt resp = @handler.call(context) if context.[:redirect_region] call_attempt.region = context.[:redirect_region] end headers = context.http_response.headers if headers.include?("x-amz-id-2") call_attempt.x_amz_id_2 = headers["x-amz-id-2"] end if headers.include?("x-amz-request-id") call_attempt.x_amz_request_id = headers["x-amz-request-id"] end if headers.include?("x-amzn-request-id") call_attempt.x_amzn_request_id = headers["x-amzn-request-id"] end call_attempt.http_status_code = context.http_response.status_code context.[:current_call_attempt] = call_attempt request_metrics.add_call_attempt(call_attempt) resp end |