Reference documentation and code samples for the Cloud Profiler V2 API class Google::Cloud::Profiler::V2::ProfilerService::Rest::Client.
REST client for the ProfilerService service.
Manage the collection of continuous profiling data provided by profiling agents running in the cloud or by an offline provider of profiling data.
General guidelines:
- Profiles for a single deployment must be created in ascending time order.
- Profiles can be created in either online or offline mode, see below.
Inherits
- Object
Methods
.configure
def self.configure() { |config| ... } -> Client::Configuration
Configure the ProfilerService Client class.
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
# Modify the configuration for all ProfilerService clients ::Google::Cloud::Profiler::V2::ProfilerService::Rest::Client.configure do |config| config.timeout = 10.0 end
#configure
def configure() { |config| ... } -> Client::Configuration
Configure the ProfilerService Client instance.
The configuration is set to the derived mode, meaning that values can be changed, but structural changes (adding new fields, etc.) are not allowed. Structural changes should be made on Client.configure.
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
#create_offline_profile
def create_offline_profile(request, options = nil) -> ::Google::Cloud::Profiler::V2::Profile
def create_offline_profile(parent: nil, profile: nil) -> ::Google::Cloud::Profiler::V2::Profile
CreateOfflineProfile creates a new profile resource in the offline mode. The client provides the profile to create along with the profile bytes, the server records it.
def create_offline_profile(request, options = nil) -> ::Google::Cloud::Profiler::V2::Profile
create_offline_profile
via a request object, either of type
CreateOfflineProfileRequest or an equivalent Hash.
- request (::Google::Cloud::Profiler::V2::CreateOfflineProfileRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def create_offline_profile(parent: nil, profile: nil) -> ::Google::Cloud::Profiler::V2::Profile
create_offline_profile
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
- parent (::String) — Parent project to create the profile in.
- profile (::Google::Cloud::Profiler::V2::Profile, ::Hash) — Contents of the profile to create.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::Profiler::V2::Profile)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/cloud/profiler/v2" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Profiler::V2::ProfilerService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Profiler::V2::CreateOfflineProfileRequest.new # Call the create_offline_profile method. result = client.create_offline_profile request # The returned object is of type Google::Cloud::Profiler::V2::Profile. p result
#create_profile
def create_profile(request, options = nil) -> ::Google::Cloud::Profiler::V2::Profile
def create_profile(parent: nil, deployment: nil, profile_type: nil) -> ::Google::Cloud::Profiler::V2::Profile
CreateProfile creates a new profile resource in the online mode.
The server ensures that the new profiles are created at a constant rate per deployment, so the creation request may hang for some time until the next profile session is available.
The request may fail with ABORTED error if the creation is not available within ~1m, the response will indicate the duration of the backoff the client should take before attempting creating a profile again. The backoff duration is returned in google.rpc.RetryInfo extension on the response status. To a gRPC client, the extension will be return as a binary-serialized proto in the trailing metadata item named "google.rpc.retryinfo-bin".
def create_profile(request, options = nil) -> ::Google::Cloud::Profiler::V2::Profile
create_profile
via a request object, either of type
CreateProfileRequest or an equivalent Hash.
- request (::Google::Cloud::Profiler::V2::CreateProfileRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def create_profile(parent: nil, deployment: nil, profile_type: nil) -> ::Google::Cloud::Profiler::V2::Profile
create_profile
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
- parent (::String) — Parent project to create the profile in.
- deployment (::Google::Cloud::Profiler::V2::Deployment, ::Hash) — Deployment details.
- profile_type (::Array<::Google::Cloud::Profiler::V2::ProfileType>) — One or more profile types that the agent is capable of providing.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::Profiler::V2::Profile)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/cloud/profiler/v2" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Profiler::V2::ProfilerService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Profiler::V2::CreateProfileRequest.new # Call the create_profile method. result = client.create_profile request # The returned object is of type Google::Cloud::Profiler::V2::Profile. p result
#initialize
def initialize() { |config| ... } -> Client
Create a new ProfilerService REST client object.
- (config) — Configure the ProfilerService client.
- config (Client::Configuration)
- (Client) — a new instance of Client
# Create a client using the default configuration client = ::Google::Cloud::Profiler::V2::ProfilerService::Rest::Client.new # Create a client using a custom configuration client = ::Google::Cloud::Profiler::V2::ProfilerService::Rest::Client.new do |config| config.timeout = 10.0 end
#universe_domain
def universe_domain() -> String
The effective universe domain
- (String)
#update_profile
def update_profile(request, options = nil) -> ::Google::Cloud::Profiler::V2::Profile
def update_profile(profile: nil, update_mask: nil) -> ::Google::Cloud::Profiler::V2::Profile
UpdateProfile updates the profile bytes and labels on the profile resource created in the online mode. Updating the bytes for profiles created in the offline mode is currently not supported: the profile content must be provided at the time of the profile creation.
def update_profile(request, options = nil) -> ::Google::Cloud::Profiler::V2::Profile
update_profile
via a request object, either of type
UpdateProfileRequest or an equivalent Hash.
- request (::Google::Cloud::Profiler::V2::UpdateProfileRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def update_profile(profile: nil, update_mask: nil) -> ::Google::Cloud::Profiler::V2::Profile
update_profile
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
- profile (::Google::Cloud::Profiler::V2::Profile, ::Hash) — Profile to update.
- update_mask (::Google::Protobuf::FieldMask, ::Hash) — Field mask used to specify the fields to be overwritten. Currently only profile_bytes and labels fields are supported by UpdateProfile, so only those fields can be specified in the mask. When no mask is provided, all fields are overwritten.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::Profiler::V2::Profile)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/cloud/profiler/v2" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Profiler::V2::ProfilerService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Profiler::V2::UpdateProfileRequest.new # Call the update_profile method. result = client.update_profile request # The returned object is of type Google::Cloud::Profiler::V2::Profile. p result