Class: Aws::Plugins::UserAgent Private

Inherits:
Seahorse::Client::Plugin show all
Defined in:
lib/aws-sdk-core/plugins/user_agent.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.

Defined Under Namespace

Classes: Handler

Constant Summary collapse

METRICS =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Aws::Json.load(<<-METRICS)
  {
    "RESOURCE_MODEL": "A",
    "WAITER": "B",
    "PAGINATOR": "C",
    "RETRY_MODE_LEGACY": "D",
    "RETRY_MODE_STANDARD": "E",
    "RETRY_MODE_ADAPTIVE": "F",
    "S3_TRANSFER": "G",
    "S3_CRYPTO_V1N": "H",
    "S3_CRYPTO_V2": "I",
    "S3_EXPRESS_BUCKET": "J",
    "S3_ACCESS_GRANTS": "K",
    "GZIP_REQUEST_COMPRESSION": "L"
  }
METRICS

Class Method Summary collapse

Methods inherited from Seahorse::Client::Plugin

#add_handlers, #add_options, #after_initialize, after_initialize, after_initialize_hooks, #before_initialize, before_initialize, before_initialize_hooks, handlers, literal, option, options

Methods included from Seahorse::Client::HandlerBuilder

#handle, #handle_request, #handle_response, #handler_for, #new_handler

Class Method Details

.feature(_feature, &block) ⇒ 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.

Deprecated - must exist for old service gems



44
45
46
# File 'lib/aws-sdk-core/plugins/user_agent.rb', line 44

def self.feature(_feature, &block)
  block.call
end

.metric(metric, &block) ⇒ 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.



48
49
50
51
52
53
54
55
56
57
# File 'lib/aws-sdk-core/plugins/user_agent.rb', line 48

def self.metric(metric, &block)
  Thread.current[:aws_sdk_core_user_agent_metric] ||= []
  Thread.current[:aws_sdk_core_user_agent_metric] << METRICS[metric]
  block.call
ensure
  Thread.current[:aws_sdk_core_user_agent_metric].pop
  if Thread.current[:aws_sdk_core_user_agent_metric].empty?
    Thread.current[:aws_sdk_core_user_agent_metric] = nil
  end
end