pub struct ProfilerService { /* private fields */ }Expand description
Implements a client for the Cloud Profiler API.
§Example
let client = ProfilerService::builder().build().await?;
// use `client` to make requests to the Cloud Profiler API.§Service Description
Manage the collection of continuous profiling data provided by profiling agents running in the cloud or by an offline provider of profiling data.
The APIs listed in this service are intended for use within our profiler agents only.
§Configuration
To configure ProfilerService use the with_* methods in the type returned
by builder(). The default configuration should
work for most applications. Common configuration changes include
- with_endpoint(): by default this client uses the global default endpoint
(
https://cloudprofiler.googleapis.com). Applications using regional endpoints or running in restricted networks (e.g. a network configured override this default. - with_credentials(): by default this client uses Application Default Credentials. Applications using custom authentication may need to override this default.
§Pooling and Cloning
ProfilerService holds a connection pool internally, it is advised to
create one and the reuse it. You do not need to wrap ProfilerService in
an Rc or Arc to reuse it, because it
already uses an Arc internally.
Implementations§
Source§impl ProfilerService
impl ProfilerService
Sourcepub fn builder() -> ClientBuilder
pub fn builder() -> ClientBuilder
Returns a builder for ProfilerService.
let client = ProfilerService::builder().build().await?;Sourcepub fn from_stub<T>(stub: T) -> Selfwhere
T: ProfilerService + 'static,
pub fn from_stub<T>(stub: T) -> Selfwhere
T: ProfilerService + 'static,
Creates a new client from the provided stub.
The most common case for calling this function is in tests mocking the client’s behavior.
Sourcepub fn create_profile(&self) -> CreateProfile
pub fn create_profile(&self) -> CreateProfile
CreateProfile creates a new profile resource in the online mode.
Direct use of this API is discouraged, please use a supported profiler 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”.
Sourcepub fn create_offline_profile(&self) -> CreateOfflineProfile
pub fn create_offline_profile(&self) -> CreateOfflineProfile
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 instead for profile collection.
Sourcepub fn update_profile(&self) -> UpdateProfile
pub fn update_profile(&self) -> UpdateProfile
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 instead for profile collection.
Trait Implementations§
Source§impl Clone for ProfilerService
impl Clone for ProfilerService
Source§fn clone(&self) -> ProfilerService
fn clone(&self) -> ProfilerService
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more