Skip to content

Commit

Permalink
feat: [cloudprofiler] add start_time to Profile proto (#10434)
Browse files Browse the repository at this point in the history
- [ ] Regenerate this pull request now.

docs: update documentation to add guidance around use of ProfilerService API methods

PiperOrigin-RevId: 609836544

Source-Link: https://togithub.com/googleapis/googleapis/commit/c5b43c89282bb8c39cbfbc0dc226386292633fa4

Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/aefdaf1520429808b5d954ae24f2922e251c2a89
Copy-Tag: eyJwIjoiamF2YS1wcm9maWxlci8uT3dsQm90LnlhbWwiLCJoIjoiYWVmZGFmMTUyMDQyOTgwOGI1ZDk1NGFlMjRmMjkyMmUyNTFjMmE4OSJ9
  • Loading branch information
gcf-owl-bot[bot] committed Feb 29, 2024
1 parent 9adf018 commit c04c4f6
Show file tree
Hide file tree
Showing 19 changed files with 853 additions and 177 deletions.
4 changes: 2 additions & 2 deletions java-profiler/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file:
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>libraries-bom</artifactId>
<version>26.32.0</version>
<version>26.33.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down Expand Up @@ -195,7 +195,7 @@ Java is a registered trademark of Oracle and/or its affiliates.
[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java11.html
[stability-image]: https://img.shields.io/badge/stability-stable-green
[maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-profiler.svg
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-profiler/2.35.0
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-profiler/2.36.0
[authentication]: https://github.com/googleapis/google-cloud-java#authentication
[auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes
[predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,8 @@
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (ExportServiceClient exportServiceClient = ExportServiceClient.create()) {
* ListProfilesRequest request =
* ListProfilesRequest.newBuilder()
* .setParent(ProjectName.of("[PROJECT]").toString())
* .setPageSize(883849137)
* .setPageToken("pageToken873572522")
* .build();
* for (Profile element : exportServiceClient.listProfiles(request).iterateAll()) {
* ProjectName parent = ProjectName.of("[PROJECT]");
* for (Profile element : exportServiceClient.listProfiles(parent).iterateAll()) {
* // doThingsWith(element);
* }
* }
Expand All @@ -77,6 +72,11 @@
* <ul>
* <li><p> listProfiles(ListProfilesRequest request)
* </ul>
* <p>"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.</p>
* <ul>
* <li><p> listProfiles(ProjectName parent)
* <li><p> listProfiles(String parent)
* </ul>
* <p>Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.</p>
* <ul>
* <li><p> listProfilesPagedCallable()
Expand Down Expand Up @@ -189,6 +189,69 @@ public ExportServiceStub getStub() {
return stub;
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists profiles which have been collected so far and for which the caller has permission to
* view.
*
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (ExportServiceClient exportServiceClient = ExportServiceClient.create()) {
* ProjectName parent = ProjectName.of("[PROJECT]");
* for (Profile element : exportServiceClient.listProfiles(parent).iterateAll()) {
* // doThingsWith(element);
* }
* }
* }</pre>
*
* @param parent Required. The parent, which owns this collection of profiles. Format:
* projects/{user_project_id}
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final ListProfilesPagedResponse listProfiles(ProjectName parent) {
ListProfilesRequest request =
ListProfilesRequest.newBuilder()
.setParent(parent == null ? null : parent.toString())
.build();
return listProfiles(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists profiles which have been collected so far and for which the caller has permission to
* view.
*
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (ExportServiceClient exportServiceClient = ExportServiceClient.create()) {
* String parent = ProjectName.of("[PROJECT]").toString();
* for (Profile element : exportServiceClient.listProfiles(parent).iterateAll()) {
* // doThingsWith(element);
* }
* }
* }</pre>
*
* @param parent Required. The parent, which owns this collection of profiles. Format:
* projects/{user_project_id}
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final ListProfilesPagedResponse listProfiles(String parent) {
ListProfilesRequest request = ListProfilesRequest.newBuilder().setParent(parent).build();
return listProfiles(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists profiles which have been collected so far and for which the caller has permission to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,7 @@
* 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.
*
* <p>General guidelines:
*
* <ul>
* <li>Profiles for a single deployment must be created in ascending time order.
* <li>Profiles can be created in either online or offline mode, see below.
* </ul>
* <p>__The APIs listed in this service are intended for use within our profiler agents only.__
*
* <p>This class provides the ability to make remote calls to the backing service through method
* calls that map to API methods. Sample code to get started:
Expand Down Expand Up @@ -71,6 +66,7 @@
* <tr>
* <td><p> CreateProfile</td>
* <td><p> CreateProfile creates a new profile resource in the online mode.
* <p> _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._
* <p> 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.
* <p> 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".</td>
* <td>
Expand All @@ -86,7 +82,8 @@
* </tr>
* <tr>
* <td><p> CreateOfflineProfile</td>
* <td><p> 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.</td>
* <td><p> 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.
* <p> _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._</td>
* <td>
* <p>Request object method variants only take one parameter, a request object, which must be constructed before the call.</p>
* <ul>
Expand All @@ -105,7 +102,8 @@
* </tr>
* <tr>
* <td><p> UpdateProfile</td>
* <td><p> 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.</td>
* <td><p> 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.
* <p> _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._</td>
* <td>
* <p>Request object method variants only take one parameter, a request object, which must be constructed before the call.</p>
* <ul>
Expand Down Expand Up @@ -233,6 +231,10 @@ public ProfilerServiceStub getStub() {
/**
* CreateProfile creates a new profile resource in the online mode.
*
* <p>_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._
*
* <p>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.
*
Expand Down Expand Up @@ -272,6 +274,10 @@ public final Profile createProfile(CreateProfileRequest request) {
/**
* CreateProfile creates a new profile resource in the online mode.
*
* <p>_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._
*
* <p>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.
*
Expand Down Expand Up @@ -311,6 +317,10 @@ public final UnaryCallable<CreateProfileRequest, Profile> createProfileCallable(
* 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.
*
* <p>_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._
*
* <p>Sample code:
*
* <pre>{@code
Expand Down Expand Up @@ -344,6 +354,10 @@ public final Profile createOfflineProfile(ProjectName parent, Profile 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.
*
* <p>_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._
*
* <p>Sample code:
*
* <pre>{@code
Expand Down Expand Up @@ -374,6 +388,10 @@ public final Profile createOfflineProfile(String parent, Profile 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.
*
* <p>_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._
*
* <p>Sample code:
*
* <pre>{@code
Expand Down Expand Up @@ -404,6 +422,10 @@ public final Profile createOfflineProfile(CreateOfflineProfileRequest request) {
* 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.
*
* <p>_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._
*
* <p>Sample code:
*
* <pre>{@code
Expand Down Expand Up @@ -435,6 +457,10 @@ public final UnaryCallable<CreateOfflineProfileRequest, Profile> createOfflinePr
* 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.
*
* <p>_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._
*
* <p>Sample code:
*
* <pre>{@code
Expand Down Expand Up @@ -468,6 +494,10 @@ public final Profile updateProfile(Profile profile, FieldMask updateMask) {
* 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.
*
* <p>_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._
*
* <p>Sample code:
*
* <pre>{@code
Expand Down Expand Up @@ -499,6 +529,10 @@ public final Profile updateProfile(UpdateProfileRequest request) {
* 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.
*
* <p>_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._
*
* <p>Sample code:
*
* <pre>{@code
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"libraryClient": "ExportServiceClient",
"rpcs": {
"ListProfiles": {
"methods": ["listProfiles", "listProfilesPagedCallable", "listProfilesCallable"]
"methods": ["listProfiles", "listProfiles", "listProfiles", "listProfilesPagedCallable", "listProfilesCallable"]
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,7 @@
* <p>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.
*
* <p>General guidelines:
*
* <ul>
* <li>Profiles for a single deployment must be created in ascending time order.
* <li>Profiles can be created in either online or offline mode, see below.
* </ul>
* <p>__The APIs listed in this service are intended for use within our profiler agents only.__
*
* <p>Sample for ProfilerServiceClient:
*
Expand Down Expand Up @@ -64,13 +59,8 @@
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (ExportServiceClient exportServiceClient = ExportServiceClient.create()) {
* ListProfilesRequest request =
* ListProfilesRequest.newBuilder()
* .setParent(ProjectName.of("[PROJECT]").toString())
* .setPageSize(883849137)
* .setPageToken("pageToken873572522")
* .build();
* for (Profile element : exportServiceClient.listProfiles(request).iterateAll()) {
* ProjectName parent = ProjectName.of("[PROJECT]");
* for (Profile element : exportServiceClient.listProfiles(parent).iterateAll()) {
* // doThingsWith(element);
* }
* }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1276,5 +1276,23 @@
"allPublicMethods": true,
"allDeclaredClasses": true,
"allPublicClasses": true
},
{
"name": "com.google.protobuf.Timestamp",
"queryAllDeclaredConstructors": true,
"queryAllPublicConstructors": true,
"queryAllDeclaredMethods": true,
"allPublicMethods": true,
"allDeclaredClasses": true,
"allPublicClasses": true
},
{
"name": "com.google.protobuf.Timestamp$Builder",
"queryAllDeclaredConstructors": true,
"queryAllPublicConstructors": true,
"queryAllDeclaredMethods": true,
"allPublicMethods": true,
"allDeclaredClasses": true,
"allPublicClasses": true
}
]
Loading

0 comments on commit c04c4f6

Please sign in to comment.