public abstract class ProfilerServiceClient
Reference documentation and code samples for the Cloud Profiler v2 API class ProfilerServiceClient.
ProfilerService client wrapper, for convenient use.
Derived Types
Namespace
GoogleGoogle.CloudGoogle.Cloud.ProfilerV2Assembly
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 | |
---|---|
Type | Description |
string |
DefaultScopes
public static IReadOnlyList<string> DefaultScopes { get; }
The default ProfilerService scopes.
Property Value | |
---|---|
Type | Description |
IReadOnlyListstring |
The default ProfilerService scopes are:
GrpcClient
public virtual ProfilerService.ProfilerServiceClient GrpcClient { get; }
The underlying gRPC ProfilerService client
Property Value | |
---|---|
Type | Description |
ProfilerServiceProfilerServiceClient |
ServiceMetadata
public static ServiceMetadata ServiceMetadata { get; }
The service metadata associated with this client type.
Property Value | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
ProfilerServiceClient | The created ProfilerServiceClient. |
CreateAsync(CancellationToken)
public static Task<ProfilerServiceClient> CreateAsync(CancellationToken cancellationToken = default)
Asynchronously creates a ProfilerServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use ProfilerServiceClientBuilder.
Parameter | |
---|---|
Name | Description |
cancellationToken | CancellationToken The CancellationToken to use while creating the client. |
Returns | |
---|---|
Type | Description |
TaskProfilerServiceClient | The task representing the created ProfilerServiceClient. |
CreateOfflineProfile(ProjectName, Profile, CallSettings)
public virtual Profile CreateOfflineProfile(ProjectName parent, Profile profile, 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 | |
---|---|
Name | Description |
parent | ProjectName Parent project to create the profile in. |
profile | Profile Contents of the profile to create. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Profile | The RPC response. |
// Create client
ProfilerServiceClient profilerServiceClient = ProfilerServiceClient.Create();
// Initialize request argument(s)
ProjectName parent = ProjectName.FromProject("[PROJECT]");
Profile profile = new Profile();
// Make the request
Profile response = profilerServiceClient.CreateOfflineProfile(parent, profile);
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 | |
---|---|
Name | Description |
request | CreateOfflineProfileRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Profile | The RPC response. |
// Create client
ProfilerServiceClient profilerServiceClient = ProfilerServiceClient.Create();
// Initialize request argument(s)
CreateOfflineProfileRequest request = new CreateOfflineProfileRequest
{
ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
Profile = new Profile(),
};
// Make the request
Profile response = profilerServiceClient.CreateOfflineProfile(request);
CreateOfflineProfile(string, Profile, CallSettings)
public virtual Profile CreateOfflineProfile(string parent, Profile profile, 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 | |
---|---|
Name | Description |
parent | string Parent project to create the profile in. |
profile | Profile Contents of the profile to create. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Profile | The RPC response. |
// Create client
ProfilerServiceClient profilerServiceClient = ProfilerServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]";
Profile profile = new Profile();
// Make the request
Profile response = profilerServiceClient.CreateOfflineProfile(parent, profile);
CreateOfflineProfileAsync(ProjectName, Profile, CallSettings)
public virtual Task<Profile> CreateOfflineProfileAsync(ProjectName parent, Profile profile, 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 | |
---|---|
Name | Description |
parent | ProjectName Parent project to create the profile in. |
profile | Profile Contents of the profile to create. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskProfile | A Task containing the RPC response. |
// Create client
ProfilerServiceClient profilerServiceClient = await ProfilerServiceClient.CreateAsync();
// Initialize request argument(s)
ProjectName parent = ProjectName.FromProject("[PROJECT]");
Profile profile = new Profile();
// Make the request
Profile response = await profilerServiceClient.CreateOfflineProfileAsync(parent, profile);
CreateOfflineProfileAsync(ProjectName, Profile, CancellationToken)
public virtual Task<Profile> CreateOfflineProfileAsync(ProjectName parent, Profile profile, 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 | |
---|---|
Name | Description |
parent | ProjectName Parent project to create the profile in. |
profile | Profile Contents of the profile to create. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskProfile | A Task containing the RPC response. |
// Create client
ProfilerServiceClient profilerServiceClient = await ProfilerServiceClient.CreateAsync();
// Initialize request argument(s)
ProjectName parent = ProjectName.FromProject("[PROJECT]");
Profile profile = new Profile();
// Make the request
Profile response = await profilerServiceClient.CreateOfflineProfileAsync(parent, profile);
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 | |
---|---|
Name | Description |
request | CreateOfflineProfileRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskProfile | A Task containing the RPC response. |
// Create client
ProfilerServiceClient profilerServiceClient = await ProfilerServiceClient.CreateAsync();
// Initialize request argument(s)
CreateOfflineProfileRequest request = new CreateOfflineProfileRequest
{
ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
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 | |
---|---|
Name | Description |
request | CreateOfflineProfileRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskProfile | A Task containing the RPC response. |
// Create client
ProfilerServiceClient profilerServiceClient = await ProfilerServiceClient.CreateAsync();
// Initialize request argument(s)
CreateOfflineProfileRequest request = new CreateOfflineProfileRequest
{
ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
Profile = new Profile(),
};
// Make the request
Profile response = await profilerServiceClient.CreateOfflineProfileAsync(request);
CreateOfflineProfileAsync(string, Profile, CallSettings)
public virtual Task<Profile> CreateOfflineProfileAsync(string parent, Profile profile, 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 | |
---|---|
Name | Description |
parent | string Parent project to create the profile in. |
profile | Profile Contents of the profile to create. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskProfile | A Task containing the RPC response. |
// Create client
ProfilerServiceClient profilerServiceClient = await ProfilerServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]";
Profile profile = new Profile();
// Make the request
Profile response = await profilerServiceClient.CreateOfflineProfileAsync(parent, profile);
CreateOfflineProfileAsync(string, Profile, CancellationToken)
public virtual Task<Profile> CreateOfflineProfileAsync(string parent, Profile profile, 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 | |
---|---|
Name | Description |
parent | string Parent project to create the profile in. |
profile | Profile Contents of the profile to create. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskProfile | A Task containing the RPC response. |
// Create client
ProfilerServiceClient profilerServiceClient = await ProfilerServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]";
Profile profile = new Profile();
// Make the request
Profile response = await profilerServiceClient.CreateOfflineProfileAsync(parent, profile);
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 | |
---|---|
Name | Description |
request | CreateProfileRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Profile | The RPC response. |
// Create client
ProfilerServiceClient profilerServiceClient = ProfilerServiceClient.Create();
// Initialize request argument(s)
CreateProfileRequest request = new CreateProfileRequest
{
Deployment = new Deployment(),
ProfileType =
{
ProfileType.Unspecified,
},
ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
};
// 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 | |
---|---|
Name | Description |
request | CreateProfileRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskProfile | A Task containing the RPC response. |
// Create client
ProfilerServiceClient profilerServiceClient = await ProfilerServiceClient.CreateAsync();
// Initialize request argument(s)
CreateProfileRequest request = new CreateProfileRequest
{
Deployment = new Deployment(),
ProfileType =
{
ProfileType.Unspecified,
},
ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
};
// 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 | |
---|---|
Name | Description |
request | CreateProfileRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskProfile | A Task containing the RPC response. |
// Create client
ProfilerServiceClient profilerServiceClient = await ProfilerServiceClient.CreateAsync();
// Initialize request argument(s)
CreateProfileRequest request = new CreateProfileRequest
{
Deployment = new Deployment(),
ProfileType =
{
ProfileType.Unspecified,
},
ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
};
// 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 | |
---|---|
Type | Description |
Task | A task representing the asynchronous shutdown operation. |
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(Profile, FieldMask, CallSettings)
public virtual Profile UpdateProfile(Profile profile, FieldMask updateMask, 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 | |
---|---|
Name | Description |
profile | Profile Profile to update. |
updateMask | FieldMask 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. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Profile | The RPC response. |
// Create client
ProfilerServiceClient profilerServiceClient = ProfilerServiceClient.Create();
// Initialize request argument(s)
Profile profile = new Profile();
FieldMask updateMask = new FieldMask();
// Make the request
Profile response = profilerServiceClient.UpdateProfile(profile, updateMask);
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 | |
---|---|
Name | Description |
request | UpdateProfileRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Profile | The RPC response. |
// 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(Profile, FieldMask, CallSettings)
public virtual Task<Profile> UpdateProfileAsync(Profile profile, FieldMask updateMask, 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 | |
---|---|
Name | Description |
profile | Profile Profile to update. |
updateMask | FieldMask 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. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskProfile | A Task containing the RPC response. |
// Create client
ProfilerServiceClient profilerServiceClient = await ProfilerServiceClient.CreateAsync();
// Initialize request argument(s)
Profile profile = new Profile();
FieldMask updateMask = new FieldMask();
// Make the request
Profile response = await profilerServiceClient.UpdateProfileAsync(profile, updateMask);
UpdateProfileAsync(Profile, FieldMask, CancellationToken)
public virtual Task<Profile> UpdateProfileAsync(Profile profile, FieldMask updateMask, 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 | |
---|---|
Name | Description |
profile | Profile Profile to update. |
updateMask | FieldMask 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. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskProfile | A Task containing the RPC response. |
// Create client
ProfilerServiceClient profilerServiceClient = await ProfilerServiceClient.CreateAsync();
// Initialize request argument(s)
Profile profile = new Profile();
FieldMask updateMask = new FieldMask();
// Make the request
Profile response = await profilerServiceClient.UpdateProfileAsync(profile, updateMask);
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 | |
---|---|
Name | Description |
request | UpdateProfileRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskProfile | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
request | UpdateProfileRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskProfile | A Task containing the RPC response. |
// 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);