profile

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Read added in v0.12.0

func Read(opt option.Option) (io.Reader, error)

Types

type Block

type Block struct {
	StartLine int
	StartCol  int
	EndLine   int
	EndCol    int
	NumState  int
	Count     int
}

Block is single block of profiling data

type Blocks

type Blocks []Block

Blocks is a type that represents a slice of Block

func (*Blocks) Coverage

func (blocks *Blocks) Coverage() float64

Coverage returns covered ratio for file

type Function

type Function struct {
	Name      string
	StartLine int
	StartCol  int
	Blocks    Blocks
}

Function is single func of profiling data

type Functions

type Functions []Function

Functions is a type that represents a slice of Function

type Profile

type Profile struct {
	ID         int
	ModulePath string
	Dir        string
	FileName   string
	Blocks     Blocks
	Functions  Functions
}

Profile is profiling data for each file

func (*Profile) FilePath

func (prof *Profile) FilePath() string

FilePath returns readable file path

func (*Profile) IsRelativeOrAbsolute

func (prof *Profile) IsRelativeOrAbsolute() bool

IsRelativeOrAbsolute returns true if FileName is relative path or absolute path

func (*Profile) RemoveModulePathFromFileName added in v0.7.2

func (prof *Profile) RemoveModulePathFromFileName() string

RemoveModulePathFromFileName returns FileName with ModulePath removed

type Profiles

type Profiles []Profile

Profiles is a type that represents a slice of Profile

Jump to

Keyboard shortcuts

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