Class ProfilerServiceClient (2.0.0)

Stay organized with collections Save and categorize content based on your preferences.
public abstract class ProfilerServiceClient

ProfilerService client wrapper, for convenient use.

Inheritance

Object > ProfilerServiceClient

Namespace

Google.Cloud.Profiler.V2

Assembly

Google.Cloud.Profiler.V2.dll

Remarks

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.

Properties

DefaultEndpoint

public static string DefaultEndpoint { get; }

The default endpoint for the ProfilerService service, which is a host of "cloudprofiler.googleapis.com" and a port of 443.

Property Value
TypeDescription
String

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default ProfilerService scopes.

Property Value
TypeDescription
IReadOnlyList<String>
Remarks

GrpcClient

public virtual ProfilerService.ProfilerServiceClient GrpcClient { get; }

The underlying gRPC ProfilerService client

Property Value
TypeDescription
ProfilerService.ProfilerServiceClient

ServiceMetadata

public static ServiceMetadata ServiceMetadata { get; }

The service metadata associated with this client type.

Property Value
TypeDescription
ServiceMetadata

Methods

Create()

public static ProfilerServiceClient Create()

Synchronously creates a ProfilerServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use ProfilerServiceClientBuilder.

Returns
TypeDescription
ProfilerServiceClient

The created ProfilerServiceClient.

CreateAsync(CancellationToken)

public static Task<ProfilerServiceClient> CreateAsync(CancellationToken cancellationToken = default(CancellationToken))

Asynchronously creates a ProfilerServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use ProfilerServiceClientBuilder.

Parameter
NameDescription
cancellationTokenCancellationToken

The CancellationToken to use while creating the client.

Returns
TypeDescription
Task<ProfilerServiceClient>

The task representing the created ProfilerServiceClient.

CreateOfflineProfile(CreateOfflineProfileRequest, CallSettings)

public virtual Profile CreateOfflineProfile(CreateOfflineProfileRequest request, CallSettings callSettings = null)

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.

Parameters
NameDescription
requestCreateOfflineProfileRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Profile

The RPC response.

Example
// Create client
ProfilerServiceClient profilerServiceClient = ProfilerServiceClient.Create();
// Initialize request argument(s)
CreateOfflineProfileRequest request = new CreateOfflineProfileRequest
{
    Parent = "",
    Profile = new Profile(),
};
// Make the request
Profile response = profilerServiceClient.CreateOfflineProfile(request);

CreateOfflineProfileAsync(CreateOfflineProfileRequest, CallSettings)

public virtual Task<Profile> CreateOfflineProfileAsync(CreateOfflineProfileRequest request, CallSettings callSettings = null)

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.

Parameters
NameDescription
requestCreateOfflineProfileRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Profile>

A Task containing the RPC response.

Example
// Create client
ProfilerServiceClient profilerServiceClient = await ProfilerServiceClient.CreateAsync();
// Initialize request argument(s)
CreateOfflineProfileRequest request = new CreateOfflineProfileRequest
{
    Parent = "",
    Profile = new Profile(),
};
// Make the request
Profile response = await profilerServiceClient.CreateOfflineProfileAsync(request);

CreateOfflineProfileAsync(CreateOfflineProfileRequest, CancellationToken)

public virtual Task<Profile> CreateOfflineProfileAsync(CreateOfflineProfileRequest request, CancellationToken cancellationToken)

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.

Parameters
NameDescription
requestCreateOfflineProfileRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Profile>

A Task containing the RPC response.

Example
// Create client
ProfilerServiceClient profilerServiceClient = await ProfilerServiceClient.CreateAsync();
// Initialize request argument(s)
CreateOfflineProfileRequest request = new CreateOfflineProfileRequest
{
    Parent = "",
    Profile = new Profile(),
};
// Make the request
Profile response = await profilerServiceClient.CreateOfflineProfileAsync(request);

CreateProfile(CreateProfileRequest, CallSettings)

public virtual Profile CreateProfile(CreateProfileRequest request, CallSettings callSettings = null)

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".

Parameters
NameDescription
requestCreateProfileRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Profile

The RPC response.

Example
// Create client
ProfilerServiceClient profilerServiceClient = ProfilerServiceClient.Create();
// Initialize request argument(s)
CreateProfileRequest request = new CreateProfileRequest
{
    Deployment = new Deployment(),
    ProfileType =
    {
        ProfileType.Unspecified,
    },
    Parent = "",
};
// Make the request
Profile response = profilerServiceClient.CreateProfile(request);

CreateProfileAsync(CreateProfileRequest, CallSettings)

public virtual Task<Profile> CreateProfileAsync(CreateProfileRequest request, CallSettings callSettings = null)

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".

Parameters
NameDescription
requestCreateProfileRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Profile>

A Task containing the RPC response.

Example
// Create client
ProfilerServiceClient profilerServiceClient = await ProfilerServiceClient.CreateAsync();
// Initialize request argument(s)
CreateProfileRequest request = new CreateProfileRequest
{
    Deployment = new Deployment(),
    ProfileType =
    {
        ProfileType.Unspecified,
    },
    Parent = "",
};
// Make the request
Profile response = await profilerServiceClient.CreateProfileAsync(request);

CreateProfileAsync(CreateProfileRequest, CancellationToken)

public virtual Task<Profile> CreateProfileAsync(CreateProfileRequest request, CancellationToken cancellationToken)

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".

Parameters
NameDescription
requestCreateProfileRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Profile>

A Task containing the RPC response.

Example
// Create client
ProfilerServiceClient profilerServiceClient = await ProfilerServiceClient.CreateAsync();
// Initialize request argument(s)
CreateProfileRequest request = new CreateProfileRequest
{
    Deployment = new Deployment(),
    ProfileType =
    {
        ProfileType.Unspecified,
    },
    Parent = "",
};
// Make the request
Profile response = await profilerServiceClient.CreateProfileAsync(request);

ShutdownDefaultChannelsAsync()

public static Task ShutdownDefaultChannelsAsync()

Shuts down any channels automatically created by Create() and CreateAsync(CancellationToken). Channels which weren't automatically created are not affected.

Returns
TypeDescription
Task

A task representing the asynchronous shutdown operation.

Remarks

After calling this method, further calls to Create() and CreateAsync(CancellationToken) will create new channels, which could in turn be shut down by another call to this method.

UpdateProfile(UpdateProfileRequest, CallSettings)

public virtual Profile UpdateProfile(UpdateProfileRequest request, CallSettings callSettings = null)

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.

Parameters
NameDescription
requestUpdateProfileRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Profile

The RPC response.

Example
// Create client
ProfilerServiceClient profilerServiceClient = ProfilerServiceClient.Create();
// Initialize request argument(s)
UpdateProfileRequest request = new UpdateProfileRequest
{
    Profile = new Profile(),
    UpdateMask = new FieldMask(),
};
// Make the request
Profile response = profilerServiceClient.UpdateProfile(request);

UpdateProfileAsync(UpdateProfileRequest, CallSettings)

public virtual Task<Profile> UpdateProfileAsync(UpdateProfileRequest request, CallSettings callSettings = null)

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.

Parameters
NameDescription
requestUpdateProfileRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Profile>

A Task containing the RPC response.

Example
// Create client
ProfilerServiceClient profilerServiceClient = await ProfilerServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateProfileRequest request = new UpdateProfileRequest
{
    Profile = new Profile(),
    UpdateMask = new FieldMask(),
};
// Make the request
Profile response = await profilerServiceClient.UpdateProfileAsync(request);

UpdateProfileAsync(UpdateProfileRequest, CancellationToken)

public virtual Task<Profile> UpdateProfileAsync(UpdateProfileRequest request, CancellationToken cancellationToken)

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.

Parameters
NameDescription
requestUpdateProfileRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Profile>

A Task containing the RPC response.

Example
// Create client
ProfilerServiceClient profilerServiceClient = await ProfilerServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateProfileRequest request = new UpdateProfileRequest
{
    Profile = new Profile(),
    UpdateMask = new FieldMask(),
};
// Make the request
Profile response = await profilerServiceClient.UpdateProfileAsync(request);