report

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2023 License: Apache-2.0 Imports: 8 Imported by: 1

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"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CPUInfo added in v0.2.0

type CPUInfo struct {
	ThresholdPercentage float64
	UsagePercentage     float64
}

CPUInfo is the CPU usage information.

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 added in v0.2.0

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

ReportCPUProfile 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 added in v0.2.0

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

ReportCPUProfile indicates an expected call of ReportCPUProfile.

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
}

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 added in v0.2.0

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

ReportCPUProfile sends the CPU 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
	Channel 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