codeguruprofiler

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: May 26, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package codeguruprofiler implements the AWS CodeGuru Profiler service.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentOrchestrationConfig

type AgentOrchestrationConfig struct {
	ProfilingEnabled bool `json:"profilingEnabled"`
}

AgentOrchestrationConfig represents agent orchestration configuration.

type AggregatedProfileTime

type AggregatedProfileTime struct {
	Period string    `json:"period,omitempty"`
	Start  time.Time `json:"start,omitzero"`
}

AggregatedProfileTime represents an aggregated profile time.

type CreateProfilingGroupInput

type CreateProfilingGroupInput struct {
	AgentOrchestrationConfig *AgentOrchestrationConfig `json:"agentOrchestrationConfig,omitempty"`
	ComputePlatform          string                    `json:"computePlatform,omitempty"`
	ProfilingGroupName       string                    `json:"profilingGroupName"`
	Tags                     map[string]string         `json:"tags,omitempty"`
}

CreateProfilingGroupInput represents the request body for CreateProfilingGroup.

type ErrorResponse

type ErrorResponse struct {
	Message string `json:"message"`
}

ErrorResponse represents an error response.

type ListProfilingGroupsResponse

type ListProfilingGroupsResponse struct {
	ProfilingGroupNames []string         `json:"profilingGroupNames"`
	ProfilingGroups     []ProfilingGroup `json:"profilingGroups"`
	NextToken           string           `json:"nextToken,omitempty"`
}

ListProfilingGroupsResponse represents the response for ListProfilingGroups.

type MemoryStorage

type MemoryStorage struct {
	Groups map[string]*ProfilingGroup `json:"groups"`
	// contains filtered or unexported fields
}

MemoryStorage is an in-memory implementation of Storage.

func NewMemoryStorage

func NewMemoryStorage(opts ...Option) *MemoryStorage

NewMemoryStorage creates a new in-memory storage.

func (*MemoryStorage) Close added in v0.6.0

func (m *MemoryStorage) Close() error

Close saves the storage state to disk if persistence is enabled.

func (*MemoryStorage) CreateProfilingGroup

func (m *MemoryStorage) CreateProfilingGroup(input *CreateProfilingGroupInput) *ProfilingGroup

CreateProfilingGroup creates a new profiling group.

func (*MemoryStorage) DeleteProfilingGroup

func (m *MemoryStorage) DeleteProfilingGroup(name string) error

DeleteProfilingGroup deletes a profiling group by name.

func (*MemoryStorage) DescribeProfilingGroup

func (m *MemoryStorage) DescribeProfilingGroup(name string) (*ProfilingGroup, error)

DescribeProfilingGroup returns a profiling group by name.

func (*MemoryStorage) ListProfilingGroups

func (m *MemoryStorage) ListProfilingGroups() []ProfilingGroup

ListProfilingGroups returns all profiling groups.

func (*MemoryStorage) MarshalJSON added in v0.6.0

func (m *MemoryStorage) MarshalJSON() ([]byte, error)

MarshalJSON serializes the storage state to JSON.

func (*MemoryStorage) UnmarshalJSON added in v0.6.0

func (m *MemoryStorage) UnmarshalJSON(data []byte) error

UnmarshalJSON restores the storage state from JSON.

func (*MemoryStorage) UpdateProfilingGroup

func (m *MemoryStorage) UpdateProfilingGroup(name string, input *UpdateProfilingGroupInput) (*ProfilingGroup, error)

UpdateProfilingGroup updates a profiling group.

type Option added in v0.6.0

type Option func(*MemoryStorage)

Option is a configuration option for MemoryStorage.

func WithDataDir added in v0.6.0

func WithDataDir(dir string) Option

WithDataDir enables persistent storage in the specified directory.

type ProfilingGroup

type ProfilingGroup struct {
	AgentOrchestrationConfig *AgentOrchestrationConfig `json:"agentOrchestrationConfig,omitempty"`
	Arn                      string                    `json:"arn"`
	ComputePlatform          string                    `json:"computePlatform"`
	CreatedAt                time.Time                 `json:"createdAt"`
	Name                     string                    `json:"name"`
	ProfilingStatus          *ProfilingStatus          `json:"profilingStatus,omitempty"`
	Tags                     map[string]string         `json:"tags,omitempty"`
	UpdatedAt                time.Time                 `json:"updatedAt"`
}

ProfilingGroup represents a CodeGuru Profiler profiling group.

type ProfilingStatus

type ProfilingStatus struct {
	LatestAgentOrchestratedAt    *time.Time             `json:"latestAgentOrchestratedAt,omitempty"`
	LatestAgentProfileReportedAt *time.Time             `json:"latestAgentProfileReportedAt,omitempty"`
	LatestAggregatedProfile      *AggregatedProfileTime `json:"latestAggregatedProfile,omitempty"`
}

ProfilingStatus represents the profiling status.

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service implements the AWS CodeGuru Profiler service.

func New

func New(storage Storage) *Service

New creates a new CodeGuru Profiler service.

func (*Service) Close added in v0.6.0

func (s *Service) Close() error

Close saves the storage state if persistence is enabled.

func (*Service) CreateProfilingGroup

func (s *Service) CreateProfilingGroup(w http.ResponseWriter, r *http.Request)

CreateProfilingGroup handles POST /profilingGroups.

func (*Service) DeleteProfilingGroup

func (s *Service) DeleteProfilingGroup(w http.ResponseWriter, r *http.Request)

DeleteProfilingGroup handles DELETE /profilingGroups/{profilingGroupName}.

func (*Service) DescribeProfilingGroup

func (s *Service) DescribeProfilingGroup(w http.ResponseWriter, r *http.Request)

DescribeProfilingGroup handles GET /profilingGroups/{profilingGroupName}.

func (*Service) ListProfilingGroups

func (s *Service) ListProfilingGroups(w http.ResponseWriter, _ *http.Request)

ListProfilingGroups handles GET /profilingGroups.

func (*Service) Name

func (s *Service) Name() string

Name returns the service name.

func (*Service) Prefix

func (s *Service) Prefix() string

Prefix returns the URL prefix for CodeGuru Profiler.

func (*Service) RegisterRoutes

func (s *Service) RegisterRoutes(r service.Router)

RegisterRoutes registers routes with the router.

func (*Service) UpdateProfilingGroup

func (s *Service) UpdateProfilingGroup(w http.ResponseWriter, r *http.Request)

UpdateProfilingGroup handles PUT /profilingGroups/{profilingGroupName}.

type Storage

type Storage interface {
	CreateProfilingGroup(input *CreateProfilingGroupInput) *ProfilingGroup
	DescribeProfilingGroup(name string) (*ProfilingGroup, error)
	UpdateProfilingGroup(name string, input *UpdateProfilingGroupInput) (*ProfilingGroup, error)
	DeleteProfilingGroup(name string) error
	ListProfilingGroups() []ProfilingGroup
}

Storage defines the interface for CodeGuru Profiler storage operations.

type UpdateProfilingGroupInput

type UpdateProfilingGroupInput struct {
	AgentOrchestrationConfig *AgentOrchestrationConfig `json:"agentOrchestrationConfig"`
}

UpdateProfilingGroupInput represents the request body for UpdateProfilingGroup.

Jump to

Keyboard shortcuts

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