prof

package
v0.0.0-...-fd2add7 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2016 License: Apache-2.0 Imports: 5 Imported by: 2

Documentation

Overview

Package prof implements internal profiling data structures

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Profile

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

Profile keeps various load-related statistics for a worker

func New

func New() *Profile

NewProfile creates a new Profile instance

func (*Profile) BeginCall

func (p *Profile) BeginCall(proc string) StopWatch

BeginCall starts a stop watch, measuring the duration of a call. It returns the stop watch interface.

func (*Profile) BeginReply

func (p *Profile) BeginReply(proc string) StopWatch

BeginReply starts a stop watch, measuring the duration of an execution. It returns the stop watch interface.

func (*Profile) Stat

func (p *Profile) Stat() *WorkerStat

type Stat

type Stat struct {
	Type           string
	Begin          int64
	End            int64
	Abort          int64
	DurAvg         float64
	DurStdDev      float64
	AbortDurAvg    float64
	AbortDurStdDev float64
}

func (*Stat) String

func (s *Stat) String() string

type StopWatch

type StopWatch interface {
	Stop()
	Abort()
}

StopWatch represents a stop watch

func NewStopWatch

func NewStopWatch(stopFunc, abortFunc func(time.Duration)) StopWatch

type WorkerStat

type WorkerStat struct {
	ReplyTotal *Stat
	ReplyProc  map[string]*Stat
	CallTotal  *Stat
	CallProc   map[string]*Stat
}

func (*WorkerStat) String

func (s *WorkerStat) String() string

Jump to

Keyboard shortcuts

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