report

package
v0.0.0-...-d4c8ae0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package report is a generated GoMock package.

Index

Constants

View Source
const (
	// CPUProfileFilenameFmt is the filename format for the CPU profile.
	// pprof.<app>.<hostname>.samples.cpu.<report_time>.pprof.
	CPUProfileFilenameFmt = "pprof.%s.%s.samples.cpu.%s.pprof"

	// HeapProfileFilenameFmt is the filename format for the heap profile.
	// pprof.<app>.<hostname>.alloc_objects.alloc_space.inuse_objects.inuse_space.<report_time>.pprof.
	HeapProfileFilenameFmt = "pprof.%s.%s.alloc_objects.alloc_space.inuse_objects.inuse_space.%s.pprof"

	// GoroutineProfileFilenameFmt is the filename format for the goroutine profile.
	// pprof.<app>.<hostname>.goroutine.<report_time>.pprof.
	GoroutineProfileFilenameFmt = "pprof.%s.%s.goroutine.%s.pprof"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CPUInfo

type CPUInfo struct {
	ThresholdPercentage float64
	UsagePercentage     float64
}

CPUInfo is the CPU usage information.

type GoroutineInfo

type GoroutineInfo struct {
	ThresholdCount int
	Count          int
}

type MemInfo

type MemInfo struct {
	ThresholdPercentage float64
	UsagePercentage     float64
}

MemInfo is the memory usage information.

type MockReporter

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

MockReporter is a mock of Reporter interface.

func NewMockReporter

func NewMockReporter(ctrl *gomock.Controller) *MockReporter

NewMockReporter creates a new mock instance.

func (*MockReporter) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockReporter) ReportCPUProfile

func (m *MockReporter) ReportCPUProfile(ctx context.Context, r io.Reader, ci CPUInfo) error

ReportCPUProfile mocks base method.

func (*MockReporter) ReportGoroutineProfile

func (m *MockReporter) ReportGoroutineProfile(ctx context.Context, r io.Reader, gi GoroutineInfo) error

ReportGoroutineProfile mocks base method.

func (*MockReporter) ReportHeapProfile

func (m *MockReporter) ReportHeapProfile(ctx context.Context, r io.Reader, mi MemInfo) error

ReportHeapProfile mocks base method.

type MockReporterMockRecorder

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

MockReporterMockRecorder is the mock recorder for MockReporter.

func (*MockReporterMockRecorder) ReportCPUProfile

func (mr *MockReporterMockRecorder) ReportCPUProfile(ctx, r, ci interface{}) *gomock.Call

ReportCPUProfile indicates an expected call of ReportCPUProfile.

func (*MockReporterMockRecorder) ReportGoroutineProfile

func (mr *MockReporterMockRecorder) ReportGoroutineProfile(ctx, r, gi interface{}) *gomock.Call

ReportGoroutineProfile indicates an expected call of ReportGoroutineProfile.

func (*MockReporterMockRecorder) ReportHeapProfile

func (mr *MockReporterMockRecorder) ReportHeapProfile(ctx, r, mi interface{}) *gomock.Call

ReportHeapProfile indicates an expected call of ReportHeapProfile.

type Reporter

type Reporter interface {
	// ReportCPUProfile sends the CPU profiling data to the specific destination.
	ReportCPUProfile(ctx context.Context, r io.Reader, ci CPUInfo) error

	// ReportHeapProfile sends the heap profiling data to the specific destination.
	ReportHeapProfile(ctx context.Context, r io.Reader, mi MemInfo) error

	// ReportGoroutineProfile sends the goroutine profiling data to the specific destination.
	ReportGoroutineProfile(ctx context.Context, r io.Reader, gi GoroutineInfo) error
}

Reporter is responsible for reporting the profiling report to the destination.

type SlackReporter

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

SlackReporter is the reporter to send the profiling report to the specific Slack channel.

func NewSlackReporter

func NewSlackReporter(opt *SlackReporterOption) *SlackReporter

NewSlackReporter returns the new SlackReporter.

func (*SlackReporter) ReportCPUProfile

func (s *SlackReporter) ReportCPUProfile(
	ctx context.Context, r io.Reader, ci CPUInfo,
) error

ReportCPUProfile sends the CPU profiling data to the Slack.

func (*SlackReporter) ReportGoroutineProfile

func (s *SlackReporter) ReportGoroutineProfile(
	ctx context.Context, r io.Reader, gi GoroutineInfo,
) error

ReportGoroutineProfile sends the goroutine profiling data to the Slack.

func (*SlackReporter) ReportHeapProfile

func (s *SlackReporter) ReportHeapProfile(
	ctx context.Context, r io.Reader, mi MemInfo,
) error

ReportHeapProfile sends the heap profiling data to the Slack.

type SlackReporterOption

type SlackReporterOption struct {
	App   string
	Token string
	// Deprecated: Use ChannelID instead. Reporting with a channel name is no longer supported because the latest Slack API for file uploads requires a channel ID instead of a channel name.
	// For more details about the Slack API, refer to: https://api.slack.com/methods/files.completeUploadExternal
	//
	// For details about the file upload process: https://api.slack.com/messaging/files#uploading_files
	Channel   string
	ChannelID string
}

SlackReporterOption is the option for the Slack reporter.

Jump to

Keyboard shortcuts

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