runtime

package
v0.0.0-...-2e0de6f Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package runtime provides runtime instrumentations around memory usage, goroutine and cgo calls.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Allocated

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

Allocated collects the number of bytes allocated and still in use.

func NewAllocated

func NewAllocated() *Allocated

NewAllocated creates a new Allocated.

func (*Allocated) Snapshot

func (a *Allocated) Snapshot() int64

Snapshot returns the current number of bytes allocated and still in use.

func (*Allocated) Update

func (a *Allocated) Update()

Update updates the number of bytes allocated and still in use.

type Cgo

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

Cgo collects the number of cgo calls made by the current process.

func NewCgo

func NewCgo() *Cgo

NewCgo creats a new Cgo.

func (*Cgo) Snapshot

func (c *Cgo) Snapshot() int64

Snapshot returns the current number of cgo calls made.

func (*Cgo) Update

func (c *Cgo) Update()

Update updates the number of cgo calls made by the current process.

type Frees

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

Frees collects the number of frees.

func NewFrees

func NewFrees() *Frees

NewFrees creates a Frees.

func (*Frees) Snapshot

func (f *Frees) Snapshot() int64

Snapshot returns the number of frees.

func (*Frees) Update

func (f *Frees) Update()

Update updates the number of frees.

type Goroutine

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

Goroutine collects the number of existing goroutines.

func NewGoroutine

func NewGoroutine() *Goroutine

NewGoroutine creats a new Goroutine.

func (*Goroutine) Snapshot

func (gr *Goroutine) Snapshot() int64

Snapshot returns the current number of existing goroutines

func (*Goroutine) Update

func (gr *Goroutine) Update()

Update udpates the number of existing goroutines.

type Heap

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

Heap collects the number of bytes allocated and still in use in the heap.

func NewHeap

func NewHeap() *Heap

NewHeap creates a new Heap.

func (*Heap) Snapshot

func (ha *Heap) Snapshot() int64

Snapshot returns the current number of bytes allocated and still in use in the heap.

func (*Heap) Update

func (ha *Heap) Update()

Update updates the number of bytes allocated and still in use in the heap.

type Lookups

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

Lookups collects the number of pointer lookups.

func NewLookups

func NewLookups() *Lookups

NewLookups creates a new Lookups.

func (*Lookups) Snapshot

func (l *Lookups) Snapshot() int64

Snapshot returns the number of pointer lookups.

func (*Lookups) Update

func (l *Lookups) Update()

Update updates the number of pointer lookups.

type Mallocs

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

Mallocs collects the number of mallocs.

func NewMallocs

func NewMallocs() *Mallocs

NewMallocs creates a new Mallocs.

func (*Mallocs) Snapshot

func (m *Mallocs) Snapshot() int64

Snapshot returns the number of mallocs.

func (*Mallocs) Update

func (m *Mallocs) Update()

Update updates the number of mallocs.

type Pauses

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

Pauses collects pauses times.

Example
pauses := NewPauses(512)
go func() {
	for {
		pauses.Update()
		time.Sleep(time.Minute)
	}
}()
perc95 := instruments.Quantile(pauses.Snapshot(), 0.95)
fmt.Println(perc95)
Output:

func NewPauses

func NewPauses(size int64) *Pauses

NewPauses creates a new Pauses.

func (*Pauses) Snapshot

func (p *Pauses) Snapshot() []int64

Snapshot returns a sample of GC pauses times.

func (*Pauses) Update

func (p *Pauses) Update()

Update updates GC pauses times.

type Stack

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

Stack collects the number of bytes used now in the stack.

func NewStack

func NewStack() *Stack

NewStack creates a new Stack.

func (*Stack) Snapshot

func (s *Stack) Snapshot() int64

Snapshot returns the current number of bytes allocated and still in use in the stack.

func (*Stack) Update

func (s *Stack) Update()

Update updates the number of bytes allocated and still in use in the stack.

Jump to

Keyboard shortcuts

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