profiler

package
v3.2.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2020 License: GPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// DocsBufferSize is the buffer size to store documents from the MongoDB profiler
	DocsBufferSize = 100
)

Functions

This section is empty.

Types

type Profile

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

Profile has unexported variables for the profiler

func (*Profile) FlushQueries

func (p *Profile) FlushQueries()

FlushQueries clean all the queries from the queries chan

func (*Profile) GetLastError

func (p *Profile) GetLastError() error

GetLastError return the latest error

func (*Profile) QueriesChan

func (p *Profile) QueriesChan() chan stats.Queries

QueriesChan returns the channels used to read the queries from the profiler

func (*Profile) Start

func (p *Profile) Start(ctx context.Context)

Start the profiler

func (*Profile) Stop

func (p *Profile) Stop()

Stop the profiler

func (*Profile) TimeoutsChan

func (p *Profile) TimeoutsChan() <-chan time.Time

TimeoutsChan returns the channels to receive timeout signals

type Profiler

type Profiler interface {
	GetLastError() error
	QueriesChan() chan stats.Queries
	TimeoutsChan() <-chan time.Time
	FlushQueries()
	Start(context.Context)
	Stop()
}

Profiler interface

func NewProfiler

func NewProfiler(cursor *mongo.Cursor, filters []filter.Filter, ticker <-chan time.Time, stats Stats) Profiler

NewProfiler returns a new instance of the profiler interface

type Stats

type Stats interface {
	Reset()
	Add(doc proto.SystemProfile) error
	Queries() stats.Queries
}

Jump to

Keyboard shortcuts

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