agent

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2021 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

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

func New

func New(ff ...Setter) (*Agent, error)

func (*Agent) Start

func (a *Agent) Start(ctx context.Context)

func (*Agent) Stop

func (a *Agent) Stop()

type Option

type Option struct {
	CollectorAddr  string
	Service        string
	ServiceVersion string

	BreakPeriod           time.Duration
	CPUProfiling          bool `profile:"cpu"`
	CPUProfilingPeriod    time.Duration
	HeapProfiling         bool `profile:"heap"`
	AllocsProfiling       bool `profile:"allocs"`
	BlockProfiling        bool `profile:"block"`
	MutexProfiling        bool `profile:"mutex"`
	GoroutineProfiling    bool `profile:"goroutine"`
	ThreadCreateProfiling bool `profile:"threadcreate"`
	// contains filtered or unexported fields
}

type ReceiveProfileReq

type ReceiveProfileReq struct {
	Service        string `json:"service"`
	ServiceVersion string `json:"service_version"`
	Host           string `json:"host"`
	GoVersion      string `json:"go_version"`
	ProfileType    string `json:"profile_type"`
	Profile        string `json:"profile"`
	SendTime       int64  `json:"send_time"`
	CreateTime     int64  `json:"create_time"`
}

type Setter

type Setter func(o *Option) error

func WithAllocsProfiling added in v0.1.3

func WithAllocsProfiling(en bool) Setter

func WithBlockProfiling added in v0.1.3

func WithBlockProfiling(en bool) Setter

func WithBreakPeriod added in v0.1.5

func WithBreakPeriod(d time.Duration) Setter

func WithCPUProfiling added in v0.1.3

func WithCPUProfiling(en bool, d time.Duration) Setter

func WithCollectorAddr

func WithCollectorAddr(addr string) Setter

func WithGoroutineProfiling added in v0.1.3

func WithGoroutineProfiling(en bool) Setter

func WithHeapProfiling added in v0.1.3

func WithHeapProfiling(en bool) Setter

func WithMutexProfiling added in v0.1.3

func WithMutexProfiling(en bool) Setter

func WithService

func WithService(service string, serviceVersion string) Setter

func WithThreadCreateProfiling added in v0.1.3

func WithThreadCreateProfiling(en bool) Setter

Jump to

Keyboard shortcuts

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