profiling

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CmdTypeSelect = iota
	CmdTypeCreate
	CmdTypeDelete
	CmdTypeRename
	CmdTypeSubscribe
	CmdTypeUnsubscribe
	CmdTypeList
	CmdTypeLSub
	CmdTypeStatus
	CmdTypeAppend
	CmdTypeCheck
	CmdTypeClose
	CmdTypeExpunge
	CmdTypeSearch
	CmdTypeFetch
	CmdTypeStore
	CmdTypeCopy
	CmdTypeNoop
	CmdTypeIdle
	CmdTypeMove
	CmdTypeID
	CmdTypeLogout
	CmdTypeUnselect
	CmdTypeLogin
	CmdTypeExamine
	CmdTypeUIDMove
	CmdTypeUIDCopy
	CmdTypeUIDStore
	CmdTypeUIDFetch
	CmdTypeUIDSearch
	CmdTypeTotal
)

Variables

This section is empty.

Functions

func CmdTypeToString

func CmdTypeToString(cmdType int) string

func Start added in v0.14.0

func Start(ctx context.Context, cmdType int)

func Stop added in v0.14.0

func Stop(ctx context.Context, cmdType int)

func WithProfiler added in v0.14.0

func WithProfiler(ctx context.Context, profiler CmdProfiler) context.Context

Types

type CmdProfiler

type CmdProfiler interface {
	// Start will be called once the command has been received and interpreted.
	Start(cmdType int)
	// Stop will be called once the command has finished executing and all the replies sent to the client.
	Stop(cmdType int)
}

CmdProfiler is the interface that can be used to perform measurements related to the execution scope of incoming IMAP commands.

type CmdProfilerBuilder

type CmdProfilerBuilder interface {
	// New creates a new CmdProfiler instance.
	New() CmdProfiler

	// Collect will be called when the IMAP client has disconnected/logged out.
	Collect(profiler CmdProfiler)
}

CmdProfilerBuilder is the interface through which an instance of the CmdProfiler gets created. One of these will be created for each connecting IMAP client.

type NullCmdExecProfilerBuilder

type NullCmdExecProfilerBuilder struct{}

func (*NullCmdExecProfilerBuilder) Collect

func (*NullCmdExecProfilerBuilder) New

type NullCmdProfiler

type NullCmdProfiler struct{}

NullCmdProfiler represents a null implementation of CmdProfiler.

func (*NullCmdProfiler) Start

func (*NullCmdProfiler) Start(int)

func (*NullCmdProfiler) Stop

func (*NullCmdProfiler) Stop(int)

Jump to

Keyboard shortcuts

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