Class: Aws::ClientSideMonitoring::RequestMetrics::ApiCall Private

Inherits:
Object
  • Object
show all
Defined in:
lib/aws-sdk-core/client_side_monitoring/request_metrics.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 collapse

Instance Method Summary collapse

Constructor Details

#initialize(service, api, client_id, version, timestamp, region) ⇒ ApiCall

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.

Returns a new instance of ApiCall



63
64
65
66
67
68
69
70
# File 'lib/aws-sdk-core/client_side_monitoring/request_metrics.rb', line 63

def initialize(service, api, client_id, version, timestamp, region)
  @service = service
  @api = api
  @client_id = client_id
  @version = version
  @timestamp = timestamp
  @region = region
end

Instance Attribute Details

#apiObject (readonly)

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.



57
58
59
# File 'lib/aws-sdk-core/client_side_monitoring/request_metrics.rb', line 57

def api
  @api
end

#attempt_countObject (readonly)

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.



57
58
59
# File 'lib/aws-sdk-core/client_side_monitoring/request_metrics.rb', line 57

def attempt_count
  @attempt_count
end

#client_idObject (readonly)

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.



57
58
59
# File 'lib/aws-sdk-core/client_side_monitoring/request_metrics.rb', line 57

def client_id
  @client_id
end

#final_aws_exceptionObject (readonly)

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.



57
58
59
# File 'lib/aws-sdk-core/client_side_monitoring/request_metrics.rb', line 57

def final_aws_exception
  @final_aws_exception
end

#final_aws_exception_messageObject (readonly)

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.



57
58
59
# File 'lib/aws-sdk-core/client_side_monitoring/request_metrics.rb', line 57

def final_aws_exception_message
  @final_aws_exception_message
end

#final_http_status_codeObject (readonly)

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.



57
58
59
# File 'lib/aws-sdk-core/client_side_monitoring/request_metrics.rb', line 57

def final_http_status_code
  @final_http_status_code
end

#final_sdk_exceptionObject (readonly)

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.



57
58
59
# File 'lib/aws-sdk-core/client_side_monitoring/request_metrics.rb', line 57

def final_sdk_exception
  @final_sdk_exception
end

#final_sdk_exception_messageObject (readonly)

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.



57
58
59
# File 'lib/aws-sdk-core/client_side_monitoring/request_metrics.rb', line 57

def final_sdk_exception_message
  @final_sdk_exception_message
end

#latencyObject (readonly)

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.



57
58
59
# File 'lib/aws-sdk-core/client_side_monitoring/request_metrics.rb', line 57

def latency
  @latency
end

#max_retries_exceededObject (readonly)

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.



57
58
59
# File 'lib/aws-sdk-core/client_side_monitoring/request_metrics.rb', line 57

def max_retries_exceeded
  @max_retries_exceeded
end

#regionObject (readonly)

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.



57
58
59
# File 'lib/aws-sdk-core/client_side_monitoring/request_metrics.rb', line 57

def region
  @region
end

#serviceObject (readonly)

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.



57
58
59
# File 'lib/aws-sdk-core/client_side_monitoring/request_metrics.rb', line 57

def service
  @service
end

#timestampObject (readonly)

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.



57
58
59
# File 'lib/aws-sdk-core/client_side_monitoring/request_metrics.rb', line 57

def timestamp
  @timestamp
end

#user_agentObject (readonly)

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.



57
58
59
# File 'lib/aws-sdk-core/client_side_monitoring/request_metrics.rb', line 57

def user_agent
  @user_agent
end

#versionObject (readonly)

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.



57
58
59
# File 'lib/aws-sdk-core/client_side_monitoring/request_metrics.rb', line 57

def version
  @version
end

Instance Method Details

#complete(opts = {}) ⇒ 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.



72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# File 'lib/aws-sdk-core/client_side_monitoring/request_metrics.rb', line 72

def complete(opts = {})
  @latency = opts[:latency]
  @attempt_count = opts[:attempt_count]
  @user_agent = opts[:user_agent]
  if opts[:final_error_retryable]
    @max_retries_exceeded = 1
  else
    @max_retries_exceeded = 0
  end
  @final_http_status_code = opts[:final_http_status_code]
  @final_aws_exception = opts[:final_aws_exception]
  @final_aws_exception_message = opts[:final_aws_exception_message]
  @final_sdk_exception = opts[:final_sdk_exception]
  @final_sdk_exception_message = opts[:final_sdk_exception_message]
  @region = opts[:region] if opts[:region] # in case region changes
end

#to_json(*a) ⇒ 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.



89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# File 'lib/aws-sdk-core/client_side_monitoring/request_metrics.rb', line 89

def to_json(*a)
  document = {
    "Type" => "ApiCall",
    "Service" => @service,
    "Api" => @api,
    "ClientId" => @client_id,
    "Timestamp" => @timestamp,
    "Version" => @version,
    "AttemptCount" => @attempt_count,
    "Latency" => @latency,
    "Region" => @region,
    "MaxRetriesExceeded" => @max_retries_exceeded,
    "UserAgent" => @user_agent,
    "FinalHttpStatusCode" => @final_http_status_code,
  }
  document["FinalSdkException"] = @final_sdk_exception if @final_sdk_exception
  document["FinalSdkExceptionMessage"] = @final_sdk_exception_message if @final_sdk_exception_message
  document["FinalAwsException"] = @final_aws_exception if @final_aws_exception
  document["FinalAwsExceptionMessage"] = @final_aws_exception_message if @final_aws_exception_message
  document = _truncate(document)
  document.to_json
end