Skip to content

Provides access to getting goroutine's ID, state and other information

Notifications You must be signed in to change notification settings

liangyaopei/goroutineinfo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go Report Card GoDoc

A repository provides access to goroutine's ID, state and otehr information by parsing message invoking runtime.Stack

Install

go get -u github.com/liangyaopei/goroutineinfo

Example

func TestGetInfoSingle(t *testing.T) {
	stacks := goroutineinfo.GetInfo(false)
	for _, stack := range stacks {
		t.Logf("id:[%d],state:[%s]", stack.ID(), stack.State())
	}
}

Benchmark

func BenchmarkGetInfoSingle(b *testing.B) {
	_ = goroutineinfo.GetInfo(false)
}

testing

go test ./... -bench=BenchmarkGetInfoSingle -benchmem -run=^$ -count=10

time cost is 0.000034 ns/op average.

About

Provides access to getting goroutine's ID, state and other information

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages