Skip to content

Commit

Permalink
feat: add start_time to Profile proto
Browse files Browse the repository at this point in the history
docs: update documentation to add guidance around use of ProfilerService API methods

PiperOrigin-RevId: 609836544
  • Loading branch information
Google APIs authored and Copybara-Service committed Feb 23, 2024
1 parent 49cec36 commit c5b43c8
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 10 deletions.
17 changes: 15 additions & 2 deletions google/devtools/cloudprofiler/v2/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,17 @@
# * extra_protoc_file_parameters
# The complete list of preserved parameters can be found in the source code.

# buildifier: disable=load-on-top

# This is an API workspace, having public visibility by default makes perfect sense.
package(default_visibility = ["//visibility:public"])

##############################################################################
# Common
##############################################################################
load("@rules_proto//proto:defs.bzl", "proto_library")
# buildifier: disable=same-origin-load
load("@com_google_googleapis_imports//:imports.bzl", "proto_library_with_info")
load("@rules_proto//proto:defs.bzl", "proto_library")

proto_library(
name = "cloudprofiler_proto",
Expand All @@ -30,6 +33,7 @@ proto_library(
"//google/api:resource_proto",
"@com_google_protobuf//:duration_proto",
"@com_google_protobuf//:field_mask_proto",
"@com_google_protobuf//:timestamp_proto",
],
)

Expand All @@ -44,6 +48,7 @@ proto_library_with_info(
##############################################################################
# Java
##############################################################################
# buildifier: disable=same-origin-load
load(
"@com_google_googleapis_imports//:imports.bzl",
"java_gapic_assembly_gradle_pkg",
Expand Down Expand Up @@ -84,6 +89,8 @@ java_gapic_library(
java_gapic_test(
name = "cloudprofiler_java_gapic_test_suite",
test_classes = [
"com.google.devtools.cloudprofiler.v2.ExportServiceClientHttpJsonTest",
"com.google.devtools.cloudprofiler.v2.ExportServiceClientTest",
"com.google.devtools.cloudprofiler.v2.ProfilerServiceClientHttpJsonTest",
"com.google.devtools.cloudprofiler.v2.ProfilerServiceClientTest",
],
Expand All @@ -106,6 +113,7 @@ java_gapic_assembly_gradle_pkg(
##############################################################################
# Go
##############################################################################
# buildifier: disable=same-origin-load
load(
"@com_google_googleapis_imports//:imports.bzl",
"go_gapic_assembly_pkg",
Expand Down Expand Up @@ -154,6 +162,7 @@ go_gapic_assembly_pkg(
##############################################################################
# Python
##############################################################################
# buildifier: disable=same-origin-load
load(
"@com_google_googleapis_imports//:imports.bzl",
"py_gapic_assembly_pkg",
Expand Down Expand Up @@ -193,6 +202,7 @@ py_gapic_assembly_pkg(
##############################################################################
# PHP
##############################################################################
# buildifier: disable=same-origin-load
load(
"@com_google_googleapis_imports//:imports.bzl",
"php_gapic_assembly_pkg",
Expand Down Expand Up @@ -230,6 +240,7 @@ php_gapic_assembly_pkg(
##############################################################################
# Node.js
##############################################################################
# buildifier: disable=same-origin-load
load(
"@com_google_googleapis_imports//:imports.bzl",
"nodejs_gapic_assembly_pkg",
Expand Down Expand Up @@ -260,6 +271,7 @@ nodejs_gapic_assembly_pkg(
##############################################################################
# Ruby
##############################################################################
# buildifier: disable=same-origin-load
load(
"@com_google_googleapis_imports//:imports.bzl",
"ruby_cloud_gapic_library",
Expand Down Expand Up @@ -314,6 +326,7 @@ ruby_gapic_assembly_pkg(
##############################################################################
# C#
##############################################################################
# buildifier: disable=same-origin-load
load(
"@com_google_googleapis_imports//:imports.bzl",
"csharp_gapic_assembly_pkg",
Expand All @@ -324,7 +337,6 @@ load(

csharp_proto_library(
name = "cloudprofiler_csharp_proto",
extra_opts = [],
deps = [":cloudprofiler_proto"],
)

Expand Down Expand Up @@ -361,6 +373,7 @@ csharp_gapic_assembly_pkg(
##############################################################################
# C++
##############################################################################
# buildifier: disable=same-origin-load
load(
"@com_google_googleapis_imports//:imports.bzl",
"cc_grpc_library",
Expand Down
3 changes: 2 additions & 1 deletion google/devtools/cloudprofiler/v2/cloudprofiler_v2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ documentation:
summary: Manages continuous profiling information.
overview: |-
The Cloud Profiler API manages the continuous profiling information
collected in cloud environments like App Engine, GKE and GCE.
collected in cloud environments like App Engine, Google Kubernetes Engine
and Compute Engine.
authentication:
rules:
Expand Down
35 changes: 28 additions & 7 deletions google/devtools/cloudprofiler/v2/profiler.proto
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/field_mask.proto";
import "google/protobuf/timestamp.proto";

option csharp_namespace = "Google.Cloud.Profiler.V2";
option go_package = "cloud.google.com/go/cloudprofiler/apiv2/cloudprofilerpb;cloudprofilerpb";
Expand All @@ -34,9 +35,8 @@ option ruby_package = "Google::Cloud::Profiler::V2";
// 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.
// __The APIs listed in this service are intended for use within our profiler
// agents only.__
service ProfilerService {
option (google.api.default_host) = "cloudprofiler.googleapis.com";
option (google.api.oauth_scopes) =
Expand All @@ -46,6 +46,11 @@ service ProfilerService {

// 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.
Expand All @@ -65,9 +70,14 @@ service ProfilerService {
};
}

// 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.
// 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._
rpc CreateOfflineProfile(CreateOfflineProfileRequest) returns (Profile) {
option (google.api.http) = {
post: "/v2/{parent=projects/*}/profiles:createOffline"
Expand All @@ -80,6 +90,11 @@ service ProfilerService {
// 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._
rpc UpdateProfile(UpdateProfileRequest) returns (Profile) {
option (google.api.http) = {
patch: "/v2/{profile.name=projects/*/profiles/*}"
Expand All @@ -104,6 +119,7 @@ service ExportService {
option (google.api.http) = {
get: "/v2/{parent=projects/*}/profiles"
};
option (google.api.method_signature) = "parent";
}
}

Expand Down Expand Up @@ -183,6 +199,11 @@ message Profile {
// get merged with the deployment labels for the final data set. See
// documentation on deployment labels for validation rules and limits.
map<string, string> labels = 6 [(google.api.field_behavior) = INPUT_ONLY];

// Output only. Start time for the profile.
// This output is only present in response from the ListProfiles method.
google.protobuf.Timestamp start_time = 7
[(google.api.field_behavior) = OUTPUT_ONLY];
}

// Deployment contains the deployment identification information.
Expand Down Expand Up @@ -264,7 +285,7 @@ message ListProfilesRequest {

// The maximum number of items to return.
// Default page_size is 1000.
// Max limit is 10000.
// Max limit is 1000.
int32 page_size = 2;

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

0 comments on commit c5b43c8

Please sign in to comment.