2.7.0 (latest) 2.6.0 2.5.0 2.4.0 2.3.0 2.2.0 2.1.0 2.0.0 1.2.0 1.1.0 1.0.0

    public class ProfilerService.ProfilerServiceClient : ClientBase<ProfilerService.ProfilerServiceClient>

Reference documentation and code samples for the Cloud Profiler v2 API class ProfilerService.ProfilerServiceClient.

Client for ProfilerService

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> [ClientBase](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ClientBase.md.txt) \> [ClientBase](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ClientBase-1.md.txt)[ProfilerService](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Profiler.V2/latest/Google.Cloud.Profiler.V2.ProfilerService.md.txt)[ProfilerServiceClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Profiler.V2/latest/Google.Cloud.Profiler.V2.ProfilerService.ProfilerServiceClient.md.txt) \> ProfilerService.ProfilerServiceClient

## Inherited Members

[ClientBase\<ProfilerService.ProfilerServiceClient\>.WithHost(string)](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ClientBase-1.md.txt#Grpc_Core_ClientBase_1_WithHost_System_String_) [ClientBase.CallInvoker](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ClientBase.md.txt#Grpc_Core_ClientBase_CallInvoker) [object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone) [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Namespace

[Google.Cloud.Profiler.V2](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Profiler.V2/latest/Google.Cloud.Profiler.V2.md.txt)

## Assembly

Google.Cloud.Profiler.V2.dll

## Constructors

### ProfilerServiceClient()

    protected ProfilerServiceClient()

Protected parameterless constructor to allow creation of test doubles.

### ProfilerServiceClient(CallInvoker)

    public ProfilerServiceClient(CallInvoker callInvoker)

Creates a new client for ProfilerService that uses a custom `CallInvoker`.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `callInvoker` | `CallInvoker` The callInvoker to use to make remote calls. |

### ProfilerServiceClient(ChannelBase)

    public ProfilerServiceClient(ChannelBase channel)

Creates a new client for ProfilerService

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `channel` | `ChannelBase` The channel to use to make remote calls. |

### ProfilerServiceClient(ClientBaseConfiguration)

    protected ProfilerServiceClient(ClientBase.ClientBaseConfiguration configuration)

Protected constructor to allow creation of configured clients.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `configuration` | `ClientBaseClientBaseConfiguration` The client configuration. |

## Methods

### CreateOfflineProfile(CreateOfflineProfileRequest, CallOptions)

    public virtual Profile CreateOfflineProfile(CreateOfflineProfileRequest request, CallOptions options)

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.

*Direct use of this API is discouraged, please use a [supported
profiler
agent](https://cloud.google.com/profiler/docs/about-profiler#profiling_agent)
instead for profile collection.*

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `CreateOfflineProfileRequest` The request to send to the server. |
| `options` | `CallOptions` The options for the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Profile` | The response received from the server. |

### CreateOfflineProfile(CreateOfflineProfileRequest, Metadata, DateTime?, CancellationToken)

    public virtual Profile CreateOfflineProfile(CreateOfflineProfileRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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.

*Direct use of this API is discouraged, please use a [supported
profiler
agent](https://cloud.google.com/profiler/docs/about-profiler#profiling_agent)
instead for profile collection.*

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `CreateOfflineProfileRequest` The request to send to the server. |
| `headers` | `Metadata` The initial metadata to send with the call. This parameter is optional. |
| `deadline` | `System.DateTime` An optional deadline for the call. The call will be cancelled if deadline is hit. |
| `cancellationToken` | `CancellationToken` An optional token for canceling the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Profile` | The response received from the server. |

### CreateOfflineProfileAsync(CreateOfflineProfileRequest, CallOptions)

    public virtual AsyncUnaryCall<Profile> CreateOfflineProfileAsync(CreateOfflineProfileRequest request, CallOptions options)

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.

*Direct use of this API is discouraged, please use a [supported
profiler
agent](https://cloud.google.com/profiler/docs/about-profiler#profiling_agent)
instead for profile collection.*

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `CreateOfflineProfileRequest` The request to send to the server. |
| `options` | `CallOptions` The options for the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `AsyncUnaryCallProfile` | The call object. |

### CreateOfflineProfileAsync(CreateOfflineProfileRequest, Metadata, DateTime?, CancellationToken)

    public virtual AsyncUnaryCall<Profile> CreateOfflineProfileAsync(CreateOfflineProfileRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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.

*Direct use of this API is discouraged, please use a [supported
profiler
agent](https://cloud.google.com/profiler/docs/about-profiler#profiling_agent)
instead for profile collection.*

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `CreateOfflineProfileRequest` The request to send to the server. |
| `headers` | `Metadata` The initial metadata to send with the call. This parameter is optional. |
| `deadline` | `System.DateTime` An optional deadline for the call. The call will be cancelled if deadline is hit. |
| `cancellationToken` | `CancellationToken` An optional token for canceling the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `AsyncUnaryCallProfile` | The call object. |

### CreateProfile(CreateProfileRequest, CallOptions)

    public virtual Profile CreateProfile(CreateProfileRequest request, CallOptions options)

CreateProfile creates a new profile resource in the online mode.

*Direct use of this API is discouraged, please use a [supported
profiler
agent](https://cloud.google.com/profiler/docs/about-profiler#profiling_agent)
instead for profile collection.*

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 to send to the server. |
| `options` | `CallOptions` The options for the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Profile` | The response received from the server. |

### CreateProfile(CreateProfileRequest, Metadata, DateTime?, CancellationToken)

    public virtual Profile CreateProfile(CreateProfileRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

CreateProfile creates a new profile resource in the online mode.

*Direct use of this API is discouraged, please use a [supported
profiler
agent](https://cloud.google.com/profiler/docs/about-profiler#profiling_agent)
instead for profile collection.*

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 to send to the server. |
| `headers` | `Metadata` The initial metadata to send with the call. This parameter is optional. |
| `deadline` | `System.DateTime` An optional deadline for the call. The call will be cancelled if deadline is hit. |
| `cancellationToken` | `CancellationToken` An optional token for canceling the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Profile` | The response received from the server. |

### CreateProfileAsync(CreateProfileRequest, CallOptions)

    public virtual AsyncUnaryCall<Profile> CreateProfileAsync(CreateProfileRequest request, CallOptions options)

CreateProfile creates a new profile resource in the online mode.

*Direct use of this API is discouraged, please use a [supported
profiler
agent](https://cloud.google.com/profiler/docs/about-profiler#profiling_agent)
instead for profile collection.*

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 to send to the server. |
| `options` | `CallOptions` The options for the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `AsyncUnaryCallProfile` | The call object. |

### CreateProfileAsync(CreateProfileRequest, Metadata, DateTime?, CancellationToken)

    public virtual AsyncUnaryCall<Profile> CreateProfileAsync(CreateProfileRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

CreateProfile creates a new profile resource in the online mode.

*Direct use of this API is discouraged, please use a [supported
profiler
agent](https://cloud.google.com/profiler/docs/about-profiler#profiling_agent)
instead for profile collection.*

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 to send to the server. |
| `headers` | `Metadata` The initial metadata to send with the call. This parameter is optional. |
| `deadline` | `System.DateTime` An optional deadline for the call. The call will be cancelled if deadline is hit. |
| `cancellationToken` | `CancellationToken` An optional token for canceling the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `AsyncUnaryCallProfile` | The call object. |

### NewInstance(ClientBaseConfiguration)

    protected override ProfilerService.ProfilerServiceClient NewInstance(ClientBase.ClientBaseConfiguration configuration)

Creates a new instance of client from given `ClientBaseConfiguration`.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `configuration` | `ClientBaseClientBaseConfiguration` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `ProfilerServiceProfilerServiceClient` |   |

**Overrides** Grpc.Core.ClientBase\<Google.Cloud.Profiler.V2.ProfilerService.ProfilerServiceClient\>.NewInstance(Grpc.Core.ClientBase.ClientBaseConfiguration)

### UpdateProfile(UpdateProfileRequest, CallOptions)

    public virtual Profile UpdateProfile(UpdateProfileRequest request, CallOptions options)

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.

*Direct use of this API is discouraged, please use a [supported
profiler
agent](https://cloud.google.com/profiler/docs/about-profiler#profiling_agent)
instead for profile collection.*

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `UpdateProfileRequest` The request to send to the server. |
| `options` | `CallOptions` The options for the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Profile` | The response received from the server. |

### UpdateProfile(UpdateProfileRequest, Metadata, DateTime?, CancellationToken)

    public virtual Profile UpdateProfile(UpdateProfileRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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.

*Direct use of this API is discouraged, please use a [supported
profiler
agent](https://cloud.google.com/profiler/docs/about-profiler#profiling_agent)
instead for profile collection.*

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `UpdateProfileRequest` The request to send to the server. |
| `headers` | `Metadata` The initial metadata to send with the call. This parameter is optional. |
| `deadline` | `System.DateTime` An optional deadline for the call. The call will be cancelled if deadline is hit. |
| `cancellationToken` | `CancellationToken` An optional token for canceling the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Profile` | The response received from the server. |

### UpdateProfileAsync(UpdateProfileRequest, CallOptions)

    public virtual AsyncUnaryCall<Profile> UpdateProfileAsync(UpdateProfileRequest request, CallOptions options)

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.

*Direct use of this API is discouraged, please use a [supported
profiler
agent](https://cloud.google.com/profiler/docs/about-profiler#profiling_agent)
instead for profile collection.*

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `UpdateProfileRequest` The request to send to the server. |
| `options` | `CallOptions` The options for the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `AsyncUnaryCallProfile` | The call object. |

### UpdateProfileAsync(UpdateProfileRequest, Metadata, DateTime?, CancellationToken)

    public virtual AsyncUnaryCall<Profile> UpdateProfileAsync(UpdateProfileRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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.

*Direct use of this API is discouraged, please use a [supported
profiler
agent](https://cloud.google.com/profiler/docs/about-profiler#profiling_agent)
instead for profile collection.*

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `UpdateProfileRequest` The request to send to the server. |
| `headers` | `Metadata` The initial metadata to send with the call. This parameter is optional. |
| `deadline` | `System.DateTime` An optional deadline for the call. The call will be cancelled if deadline is hit. |
| `cancellationToken` | `CancellationToken` An optional token for canceling the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `AsyncUnaryCallProfile` | The call object. |