cloudprofiler

package
v0.0.0-...-e165f0f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 1, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ProfileType_name = map[int32]string{
	0: "PROFILE_TYPE_UNSPECIFIED",
	1: "CPU",
	2: "WALL",
	3: "HEAP",
	4: "THREADS",
	5: "CONTENTION",
	6: "PEAK_HEAP",
	7: "HEAP_ALLOC",
}
View Source
var ProfileType_value = map[string]int32{
	"PROFILE_TYPE_UNSPECIFIED": 0,
	"CPU":                      1,
	"WALL":                     2,
	"HEAP":                     3,
	"THREADS":                  4,
	"CONTENTION":               5,
	"PEAK_HEAP":                6,
	"HEAP_ALLOC":               7,
}

Functions

func RegisterProfilerServiceServer

func RegisterProfilerServiceServer(s *grpc.Server, srv ProfilerServiceServer)

Types

type CreateOfflineProfileRequest

type CreateOfflineProfileRequest struct {
	// Parent project to create the profile in.
	Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"`
	// Contents of the profile to create.
	Profile              *Profile `protobuf:"bytes,2,opt,name=profile,proto3" json:"profile,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

CreateOfflineProfileRequest describes a profile resource offline creation request. Profile field must be set.

func (*CreateOfflineProfileRequest) Descriptor

func (*CreateOfflineProfileRequest) Descriptor() ([]byte, []int)

func (*CreateOfflineProfileRequest) GetParent

func (m *CreateOfflineProfileRequest) GetParent() string

func (*CreateOfflineProfileRequest) GetProfile

func (m *CreateOfflineProfileRequest) GetProfile() *Profile

func (*CreateOfflineProfileRequest) ProtoMessage

func (*CreateOfflineProfileRequest) ProtoMessage()

func (*CreateOfflineProfileRequest) Reset

func (m *CreateOfflineProfileRequest) Reset()

func (*CreateOfflineProfileRequest) String

func (m *CreateOfflineProfileRequest) String() string

func (*CreateOfflineProfileRequest) XXX_DiscardUnknown

func (m *CreateOfflineProfileRequest) XXX_DiscardUnknown()

func (*CreateOfflineProfileRequest) XXX_Marshal

func (m *CreateOfflineProfileRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*CreateOfflineProfileRequest) XXX_Merge

func (m *CreateOfflineProfileRequest) XXX_Merge(src proto.Message)

func (*CreateOfflineProfileRequest) XXX_Size

func (m *CreateOfflineProfileRequest) XXX_Size() int

func (*CreateOfflineProfileRequest) XXX_Unmarshal

func (m *CreateOfflineProfileRequest) XXX_Unmarshal(b []byte) error

type CreateProfileRequest

type CreateProfileRequest struct {
	// Parent project to create the profile in.
	Parent string `protobuf:"bytes,4,opt,name=parent,proto3" json:"parent,omitempty"`
	// Deployment details.
	Deployment *Deployment `protobuf:"bytes,1,opt,name=deployment,proto3" json:"deployment,omitempty"`
	// One or more profile types that the agent is capable of providing.
	ProfileType          []ProfileType `` /* 152-byte string literal not displayed */
	XXX_NoUnkeyedLiteral struct{}      `json:"-"`
	XXX_unrecognized     []byte        `json:"-"`
	XXX_sizecache        int32         `json:"-"`
}

CreateProfileRequest describes a profile resource online creation request. The deployment field must be populated. The profile_type specifies the list of profile types supported by the agent. The creation call will hang until a profile of one of these types needs to be collected.

func (*CreateProfileRequest) Descriptor

func (*CreateProfileRequest) Descriptor() ([]byte, []int)

func (*CreateProfileRequest) GetDeployment

func (m *CreateProfileRequest) GetDeployment() *Deployment

func (*CreateProfileRequest) GetParent

func (m *CreateProfileRequest) GetParent() string

func (*CreateProfileRequest) GetProfileType

func (m *CreateProfileRequest) GetProfileType() []ProfileType

func (*CreateProfileRequest) ProtoMessage

func (*CreateProfileRequest) ProtoMessage()

func (*CreateProfileRequest) Reset

func (m *CreateProfileRequest) Reset()

func (*CreateProfileRequest) String

func (m *CreateProfileRequest) String() string

func (*CreateProfileRequest) XXX_DiscardUnknown

func (m *CreateProfileRequest) XXX_DiscardUnknown()

func (*CreateProfileRequest) XXX_Marshal

func (m *CreateProfileRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*CreateProfileRequest) XXX_Merge

func (m *CreateProfileRequest) XXX_Merge(src proto.Message)

func (*CreateProfileRequest) XXX_Size

func (m *CreateProfileRequest) XXX_Size() int

func (*CreateProfileRequest) XXX_Unmarshal

func (m *CreateProfileRequest) XXX_Unmarshal(b []byte) error

type Deployment

type Deployment struct {
	// Project ID is the ID of a cloud project.
	// Validation regex: `^[a-z][-a-z0-9:.]{4,61}[a-z0-9]$`.
	ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"`
	// Target is the service name used to group related deployments:
	// * Service name for GAE Flex / Standard.
	// * Cluster and container name for GKE.
	// * User-specified string for direct GCE profiling (e.g. Java).
	// * Job name for Dataflow.
	// Validation regex: `^[a-z]([-a-z0-9_.]{0,253}[a-z0-9])?$`.
	Target string `protobuf:"bytes,2,opt,name=target,proto3" json:"target,omitempty"`
	// Labels identify the deployment within the user universe and same target.
	// Validation regex for label names: `^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`.
	// Value for an individual label must be <= 512 bytes, the total
	// size of all label names and values must be <= 1024 bytes.
	//
	// Label named "language" can be used to record the programming language of
	// the profiled deployment. The standard choices for the value include "java",
	// "go", "python", "ruby", "nodejs", "php", "dotnet".
	//
	// For deployments running on Google Cloud Platform, "zone" or "region" label
	// should be present describing the deployment location. An example of a zone
	// is "us-central1-a", an example of a region is "us-central1" or
	// "us-central".
	Labels               map[string]string `` /* 153-byte string literal not displayed */
	XXX_NoUnkeyedLiteral struct{}          `json:"-"`
	XXX_unrecognized     []byte            `json:"-"`
	XXX_sizecache        int32             `json:"-"`
}

Deployment contains the deployment identification information.

func (*Deployment) Descriptor

func (*Deployment) Descriptor() ([]byte, []int)

func (*Deployment) GetLabels

func (m *Deployment) GetLabels() map[string]string

func (*Deployment) GetProjectId

func (m *Deployment) GetProjectId() string

func (*Deployment) GetTarget

func (m *Deployment) GetTarget() string

func (*Deployment) ProtoMessage

func (*Deployment) ProtoMessage()

func (*Deployment) Reset

func (m *Deployment) Reset()

func (*Deployment) String

func (m *Deployment) String() string

func (*Deployment) XXX_DiscardUnknown

func (m *Deployment) XXX_DiscardUnknown()

func (*Deployment) XXX_Marshal

func (m *Deployment) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Deployment) XXX_Merge

func (m *Deployment) XXX_Merge(src proto.Message)

func (*Deployment) XXX_Size

func (m *Deployment) XXX_Size() int

func (*Deployment) XXX_Unmarshal

func (m *Deployment) XXX_Unmarshal(b []byte) error

type Profile

type Profile struct {
	// Output only. Opaque, server-assigned, unique ID for this profile.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Type of profile.
	// For offline mode, this must be specified when creating the profile. For
	// online mode it is assigned and returned by the server.
	ProfileType ProfileType `` /* 145-byte string literal not displayed */
	// Deployment this profile corresponds to.
	Deployment *Deployment `protobuf:"bytes,3,opt,name=deployment,proto3" json:"deployment,omitempty"`
	// Duration of the profiling session.
	// Input (for the offline mode) or output (for the online mode).
	// The field represents requested profiling duration. It may slightly differ
	// from the effective profiling duration, which is recorded in the profile
	// data, in case the profiling can't be stopped immediately (e.g. in case
	// stopping the profiling is handled asynchronously).
	Duration *duration.Duration `protobuf:"bytes,4,opt,name=duration,proto3" json:"duration,omitempty"`
	// Input only. Profile bytes, as a gzip compressed serialized proto, the
	// format is https://github.com/google/pprof/blob/master/proto/profile.proto.
	ProfileBytes []byte `protobuf:"bytes,5,opt,name=profile_bytes,json=profileBytes,proto3" json:"profile_bytes,omitempty"`
	// Input only. Labels associated to this specific profile. These labels will
	// get merged with the deployment labels for the final data set.  See
	// documentation on deployment labels for validation rules and limits.
	Labels               map[string]string `` /* 153-byte string literal not displayed */
	XXX_NoUnkeyedLiteral struct{}          `json:"-"`
	XXX_unrecognized     []byte            `json:"-"`
	XXX_sizecache        int32             `json:"-"`
}

Profile resource.

func (*Profile) Descriptor

func (*Profile) Descriptor() ([]byte, []int)

func (*Profile) GetDeployment

func (m *Profile) GetDeployment() *Deployment

func (*Profile) GetDuration

func (m *Profile) GetDuration() *duration.Duration

func (*Profile) GetLabels

func (m *Profile) GetLabels() map[string]string

func (*Profile) GetName

func (m *Profile) GetName() string

func (*Profile) GetProfileBytes

func (m *Profile) GetProfileBytes() []byte

func (*Profile) GetProfileType

func (m *Profile) GetProfileType() ProfileType

func (*Profile) ProtoMessage

func (*Profile) ProtoMessage()

func (*Profile) Reset

func (m *Profile) Reset()

func (*Profile) String

func (m *Profile) String() string

func (*Profile) XXX_DiscardUnknown

func (m *Profile) XXX_DiscardUnknown()

func (*Profile) XXX_Marshal

func (m *Profile) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Profile) XXX_Merge

func (m *Profile) XXX_Merge(src proto.Message)

func (*Profile) XXX_Size

func (m *Profile) XXX_Size() int

func (*Profile) XXX_Unmarshal

func (m *Profile) XXX_Unmarshal(b []byte) error

type ProfileType

type ProfileType int32

ProfileType is type of profiling data. NOTE: the enumeration member names are used (in lowercase) as unique string identifiers of profile types, so they must not be renamed.

const (
	// Unspecified profile type.
	ProfileType_PROFILE_TYPE_UNSPECIFIED ProfileType = 0
	// Thread CPU time sampling.
	ProfileType_CPU ProfileType = 1
	// Wallclock time sampling. More expensive as stops all threads.
	ProfileType_WALL ProfileType = 2
	// In-use heap profile. Represents a snapshot of the allocations that are
	// live at the time of the profiling.
	ProfileType_HEAP ProfileType = 3
	// Single-shot collection of all thread stacks.
	ProfileType_THREADS ProfileType = 4
	// Synchronization contention profile.
	ProfileType_CONTENTION ProfileType = 5
	// Peak heap profile.
	ProfileType_PEAK_HEAP ProfileType = 6
	// Heap allocation profile. It represents the aggregation of all allocations
	// made over the duration of the profile. All allocations are included,
	// including those that might have been freed by the end of the profiling
	// interval. The profile is in particular useful for garbage collecting
	// languages to understand which parts of the code create most of the garbage
	// collection pressure to see if those can be optimized.
	ProfileType_HEAP_ALLOC ProfileType = 7
)

func (ProfileType) EnumDescriptor

func (ProfileType) EnumDescriptor() ([]byte, []int)

func (ProfileType) String

func (x ProfileType) String() string

type ProfilerServiceClient

type ProfilerServiceClient interface {
	// CreateProfile creates a new profile resource in the online mode.
	//
	// 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".
	CreateProfile(ctx context.Context, in *CreateProfileRequest, opts ...grpc.CallOption) (*Profile, error)
	// 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(ctx context.Context, in *CreateOfflineProfileRequest, opts ...grpc.CallOption) (*Profile, error)
	// 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.
	UpdateProfile(ctx context.Context, in *UpdateProfileRequest, opts ...grpc.CallOption) (*Profile, error)
}

ProfilerServiceClient is the client API for ProfilerService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

type ProfilerServiceServer

type ProfilerServiceServer interface {
	// CreateProfile creates a new profile resource in the online mode.
	//
	// 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".
	CreateProfile(context.Context, *CreateProfileRequest) (*Profile, error)
	// 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(context.Context, *CreateOfflineProfileRequest) (*Profile, error)
	// 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.
	UpdateProfile(context.Context, *UpdateProfileRequest) (*Profile, error)
}

ProfilerServiceServer is the server API for ProfilerService service.

type UnimplementedProfilerServiceServer

type UnimplementedProfilerServiceServer struct {
}

UnimplementedProfilerServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedProfilerServiceServer) CreateOfflineProfile

func (*UnimplementedProfilerServiceServer) CreateProfile

func (*UnimplementedProfilerServiceServer) UpdateProfile

type UpdateProfileRequest

type UpdateProfileRequest struct {
	// Profile to update
	Profile *Profile `protobuf:"bytes,1,opt,name=profile,proto3" json:"profile,omitempty"`
	// Field mask used to specify the fields to be overwritten. Currently only
	// profile_bytes and labels fields are supported by UpdateProfile, so only
	// those fields can be specified in the mask. When no mask is provided, all
	// fields are overwritten.
	UpdateMask           *field_mask.FieldMask `protobuf:"bytes,2,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"`
	XXX_NoUnkeyedLiteral struct{}              `json:"-"`
	XXX_unrecognized     []byte                `json:"-"`
	XXX_sizecache        int32                 `json:"-"`
}

UpdateProfileRequest contains the profile to update.

func (*UpdateProfileRequest) Descriptor

func (*UpdateProfileRequest) Descriptor() ([]byte, []int)

func (*UpdateProfileRequest) GetProfile

func (m *UpdateProfileRequest) GetProfile() *Profile

func (*UpdateProfileRequest) GetUpdateMask

func (m *UpdateProfileRequest) GetUpdateMask() *field_mask.FieldMask

func (*UpdateProfileRequest) ProtoMessage

func (*UpdateProfileRequest) ProtoMessage()

func (*UpdateProfileRequest) Reset

func (m *UpdateProfileRequest) Reset()

func (*UpdateProfileRequest) String

func (m *UpdateProfileRequest) String() string

func (*UpdateProfileRequest) XXX_DiscardUnknown

func (m *UpdateProfileRequest) XXX_DiscardUnknown()

func (*UpdateProfileRequest) XXX_Marshal

func (m *UpdateProfileRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*UpdateProfileRequest) XXX_Merge

func (m *UpdateProfileRequest) XXX_Merge(src proto.Message)

func (*UpdateProfileRequest) XXX_Size

func (m *UpdateProfileRequest) XXX_Size() int

func (*UpdateProfileRequest) XXX_Unmarshal

func (m *UpdateProfileRequest) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL