instruments: github.com/heroku/instruments/runtime Index | Examples | Files

package runtime

import "github.com/heroku/instruments/runtime"

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

Index

Examples

Package Files

runtime.go

type Allocated Uses

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

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

func NewAllocated Uses

func NewAllocated() *Allocated

NewAllocated creates a new Allocated.

func (*Allocated) Snapshot Uses

func (a *Allocated) Snapshot() int64

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

func (*Allocated) Update Uses

func (a *Allocated) Update()

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

type Cgo Uses

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

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

func NewCgo Uses

func NewCgo() *Cgo

NewCgo creats a new Cgo.

func (*Cgo) Snapshot Uses

func (c *Cgo) Snapshot() int64

Snapshot returns the current number of cgo calls made.

func (*Cgo) Update Uses

func (c *Cgo) Update()

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

type Frees Uses

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

Frees collects the number of frees.

func NewFrees Uses

func NewFrees() *Frees

NewFrees creates a Frees.

func (*Frees) Snapshot Uses

func (f *Frees) Snapshot() int64

Snapshot returns the number of frees.

func (*Frees) Update Uses

func (f *Frees) Update()

Update updates the number of frees.

type Goroutine Uses

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

Goroutine collects the number of existing goroutines.

func NewGoroutine Uses

func NewGoroutine() *Goroutine

NewGoroutine creats a new Goroutine.

func (*Goroutine) Snapshot Uses

func (gr *Goroutine) Snapshot() int64

Snapshot returns the current number of existing goroutines

func (*Goroutine) Update Uses

func (gr *Goroutine) Update()

Update udpates the number of existing goroutines.

type Heap Uses

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

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

func NewHeap Uses

func NewHeap() *Heap

NewHeap creates a new Heap.

func (*Heap) Snapshot Uses

func (ha *Heap) Snapshot() int64

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

func (*Heap) Update Uses

func (ha *Heap) Update()

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

type Lookups Uses

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

Lookups collects the number of pointer lookups.

func NewLookups Uses

func NewLookups() *Lookups

NewLookups creates a new Lookups.

func (*Lookups) Snapshot Uses

func (l *Lookups) Snapshot() int64

Snapshot returns the number of pointer lookups.

func (*Lookups) Update Uses

func (l *Lookups) Update()

Update updates the number of pointer lookups.

type Mallocs Uses

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

Mallocs collects the number of mallocs.

func NewMallocs Uses

func NewMallocs() *Mallocs

NewMallocs creates a new Mallocs.

func (*Mallocs) Snapshot Uses

func (m *Mallocs) Snapshot() int64

Snapshot returns the number of mallocs.

func (*Mallocs) Update Uses

func (m *Mallocs) Update()

Update updates the number of mallocs.

type Pauses Uses

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

Pauses collects pauses times.

Code:

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

func NewPauses Uses

func NewPauses(size int64) *Pauses

NewPauses creates a new Pauses.

func (*Pauses) Snapshot Uses

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

Snapshot returns a sample of GC pauses times.

func (*Pauses) Update Uses

func (p *Pauses) Update()

Update updates GC pauses times.

type Stack Uses

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

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

func NewStack Uses

func NewStack() *Stack

NewStack creates a new Stack.

func (*Stack) Snapshot Uses

func (s *Stack) Snapshot() int64

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

func (*Stack) Update Uses

func (s *Stack) Update()

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

Package runtime imports 4 packages (graph). Updated 2016-10-18. Refresh now. Tools for package owners. This is an inactive package (no imports and no commits in at least two years).