Skip to content

Commit c5b43c8

Browse files
Google APIscopybara-github
authored andcommitted
feat: add start_time to Profile proto
docs: update documentation to add guidance around use of ProfilerService API methods PiperOrigin-RevId: 609836544
1 parent 49cec36 commit c5b43c8

3 files changed

Lines changed: 45 additions & 10 deletions

File tree

google/devtools/cloudprofiler/v2/BUILD.bazel

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,17 @@
99
# * extra_protoc_file_parameters
1010
# The complete list of preserved parameters can be found in the source code.
1111

12+
# buildifier: disable=load-on-top
13+
1214
# This is an API workspace, having public visibility by default makes perfect sense.
1315
package(default_visibility = ["//visibility:public"])
1416

1517
##############################################################################
1618
# Common
1719
##############################################################################
18-
load("@rules_proto//proto:defs.bzl", "proto_library")
20+
# buildifier: disable=same-origin-load
1921
load("@com_google_googleapis_imports//:imports.bzl", "proto_library_with_info")
22+
load("@rules_proto//proto:defs.bzl", "proto_library")
2023

2124
proto_library(
2225
name = "cloudprofiler_proto",
@@ -30,6 +33,7 @@ proto_library(
3033
"//google/api:resource_proto",
3134
"@com_google_protobuf//:duration_proto",
3235
"@com_google_protobuf//:field_mask_proto",
36+
"@com_google_protobuf//:timestamp_proto",
3337
],
3438
)
3539

@@ -44,6 +48,7 @@ proto_library_with_info(
4448
##############################################################################
4549
# Java
4650
##############################################################################
51+
# buildifier: disable=same-origin-load
4752
load(
4853
"@com_google_googleapis_imports//:imports.bzl",
4954
"java_gapic_assembly_gradle_pkg",
@@ -84,6 +89,8 @@ java_gapic_library(
8489
java_gapic_test(
8590
name = "cloudprofiler_java_gapic_test_suite",
8691
test_classes = [
92+
"com.google.devtools.cloudprofiler.v2.ExportServiceClientHttpJsonTest",
93+
"com.google.devtools.cloudprofiler.v2.ExportServiceClientTest",
8794
"com.google.devtools.cloudprofiler.v2.ProfilerServiceClientHttpJsonTest",
8895
"com.google.devtools.cloudprofiler.v2.ProfilerServiceClientTest",
8996
],
@@ -106,6 +113,7 @@ java_gapic_assembly_gradle_pkg(
106113
##############################################################################
107114
# Go
108115
##############################################################################
116+
# buildifier: disable=same-origin-load
109117
load(
110118
"@com_google_googleapis_imports//:imports.bzl",
111119
"go_gapic_assembly_pkg",
@@ -154,6 +162,7 @@ go_gapic_assembly_pkg(
154162
##############################################################################
155163
# Python
156164
##############################################################################
165+
# buildifier: disable=same-origin-load
157166
load(
158167
"@com_google_googleapis_imports//:imports.bzl",
159168
"py_gapic_assembly_pkg",
@@ -193,6 +202,7 @@ py_gapic_assembly_pkg(
193202
##############################################################################
194203
# PHP
195204
##############################################################################
205+
# buildifier: disable=same-origin-load
196206
load(
197207
"@com_google_googleapis_imports//:imports.bzl",
198208
"php_gapic_assembly_pkg",
@@ -230,6 +240,7 @@ php_gapic_assembly_pkg(
230240
##############################################################################
231241
# Node.js
232242
##############################################################################
243+
# buildifier: disable=same-origin-load
233244
load(
234245
"@com_google_googleapis_imports//:imports.bzl",
235246
"nodejs_gapic_assembly_pkg",
@@ -260,6 +271,7 @@ nodejs_gapic_assembly_pkg(
260271
##############################################################################
261272
# Ruby
262273
##############################################################################
274+
# buildifier: disable=same-origin-load
263275
load(
264276
"@com_google_googleapis_imports//:imports.bzl",
265277
"ruby_cloud_gapic_library",
@@ -314,6 +326,7 @@ ruby_gapic_assembly_pkg(
314326
##############################################################################
315327
# C#
316328
##############################################################################
329+
# buildifier: disable=same-origin-load
317330
load(
318331
"@com_google_googleapis_imports//:imports.bzl",
319332
"csharp_gapic_assembly_pkg",
@@ -324,7 +337,6 @@ load(
324337

325338
csharp_proto_library(
326339
name = "cloudprofiler_csharp_proto",
327-
extra_opts = [],
328340
deps = [":cloudprofiler_proto"],
329341
)
330342

@@ -361,6 +373,7 @@ csharp_gapic_assembly_pkg(
361373
##############################################################################
362374
# C++
363375
##############################################################################
376+
# buildifier: disable=same-origin-load
364377
load(
365378
"@com_google_googleapis_imports//:imports.bzl",
366379
"cc_grpc_library",

google/devtools/cloudprofiler/v2/cloudprofiler_v2.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ documentation:
1111
summary: Manages continuous profiling information.
1212
overview: |-
1313
The Cloud Profiler API manages the continuous profiling information
14-
collected in cloud environments like App Engine, GKE and GCE.
14+
collected in cloud environments like App Engine, Google Kubernetes Engine
15+
and Compute Engine.
1516
1617
authentication:
1718
rules:

google/devtools/cloudprofiler/v2/profiler.proto

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import "google/api/field_behavior.proto";
2222
import "google/api/resource.proto";
2323
import "google/protobuf/duration.proto";
2424
import "google/protobuf/field_mask.proto";
25+
import "google/protobuf/timestamp.proto";
2526

2627
option csharp_namespace = "Google.Cloud.Profiler.V2";
2728
option go_package = "cloud.google.com/go/cloudprofiler/apiv2/cloudprofilerpb;cloudprofilerpb";
@@ -34,9 +35,8 @@ option ruby_package = "Google::Cloud::Profiler::V2";
3435
// Manage the collection of continuous profiling data provided by profiling
3536
// agents running in the cloud or by an offline provider of profiling data.
3637
//
37-
// General guidelines:
38-
// * Profiles for a single deployment must be created in ascending time order.
39-
// * Profiles can be created in either online or offline mode, see below.
38+
// __The APIs listed in this service are intended for use within our profiler
39+
// agents only.__
4040
service ProfilerService {
4141
option (google.api.default_host) = "cloudprofiler.googleapis.com";
4242
option (google.api.oauth_scopes) =
@@ -46,6 +46,11 @@ service ProfilerService {
4646

4747
// CreateProfile creates a new profile resource in the online mode.
4848
//
49+
// _Direct use of this API is discouraged, please use a [supported
50+
// profiler
51+
// agent](https://cloud.google.com/profiler/docs/about-profiler#profiling_agent)
52+
// instead for profile collection._
53+
//
4954
// The server ensures that the new profiles are created at a constant rate per
5055
// deployment, so the creation request may hang for some time until the next
5156
// profile session is available.
@@ -65,9 +70,14 @@ service ProfilerService {
6570
};
6671
}
6772

68-
// CreateOfflineProfile creates a new profile resource in the offline mode.
69-
// The client provides the profile to create along with the profile bytes, the
70-
// server records it.
73+
// CreateOfflineProfile creates a new profile resource in the offline
74+
// mode. The client provides the profile to create along with the profile
75+
// bytes, the server records it.
76+
//
77+
// _Direct use of this API is discouraged, please use a [supported
78+
// profiler
79+
// agent](https://cloud.google.com/profiler/docs/about-profiler#profiling_agent)
80+
// instead for profile collection._
7181
rpc CreateOfflineProfile(CreateOfflineProfileRequest) returns (Profile) {
7282
option (google.api.http) = {
7383
post: "/v2/{parent=projects/*}/profiles:createOffline"
@@ -80,6 +90,11 @@ service ProfilerService {
8090
// created in the online mode. Updating the bytes for profiles created in the
8191
// offline mode is currently not supported: the profile content must be
8292
// provided at the time of the profile creation.
93+
//
94+
// _Direct use of this API is discouraged, please use a [supported
95+
// profiler
96+
// agent](https://cloud.google.com/profiler/docs/about-profiler#profiling_agent)
97+
// instead for profile collection._
8398
rpc UpdateProfile(UpdateProfileRequest) returns (Profile) {
8499
option (google.api.http) = {
85100
patch: "/v2/{profile.name=projects/*/profiles/*}"
@@ -104,6 +119,7 @@ service ExportService {
104119
option (google.api.http) = {
105120
get: "/v2/{parent=projects/*}/profiles"
106121
};
122+
option (google.api.method_signature) = "parent";
107123
}
108124
}
109125

@@ -183,6 +199,11 @@ message Profile {
183199
// get merged with the deployment labels for the final data set. See
184200
// documentation on deployment labels for validation rules and limits.
185201
map<string, string> labels = 6 [(google.api.field_behavior) = INPUT_ONLY];
202+
203+
// Output only. Start time for the profile.
204+
// This output is only present in response from the ListProfiles method.
205+
google.protobuf.Timestamp start_time = 7
206+
[(google.api.field_behavior) = OUTPUT_ONLY];
186207
}
187208

188209
// Deployment contains the deployment identification information.
@@ -264,7 +285,7 @@ message ListProfilesRequest {
264285

265286
// The maximum number of items to return.
266287
// Default page_size is 1000.
267-
// Max limit is 10000.
288+
// Max limit is 1000.
268289
int32 page_size = 2;
269290

270291
// The token to continue pagination and get profiles from a particular page.

0 commit comments

Comments
 (0)