Goroutines viewer

What you'll get
- View states of all goroutines at once in a diagram
- Filter by goroutine state (running, waiting, etc.)
- Search through stack traces
- View full stack traces - or just the top functions
How it works
Get PPROF data
Generate a goroutine dump from your Go application.
Visit "/debug/pprof/goroutine?debug=2".
Paste here
Copy the raw PPROF output into the text area below.
No data leaves your browser.
Analyze
View goroutines in a sortable table with filtering.
Understand your app's concurrency.
Don't have PPROF data yet?
Package pprof serves via its HTTP server runtime profiling data.
The package is typically only imported for the side effect of registering its HTTP handlers. The handled paths all begin with /debug/pprof/.
To use pprof, link this package into your program:
import _ "net/http/pprof"For instance, try running the following program:
// This is an example source code for Goroutines Viewer.
// Save it as "goroutines.go" and run it with "go run goroutines.go".
package main
import (
"log"
"net/http"
"sync"
_ "net/http/pprof"
)
var (
ch1 = make(chan string)
ch2 = make(chan string)
mutex sync.Mutex
cond = sync.NewCond(&sync.Mutex{})
wg sync.WaitGroup
rwMutex sync.RWMutex
)
func main() {
go func() {
ch1 <- "Hello World"
}()
go func() {
<-ch2
}()
mutex.Lock()
go func() {
mutex.Lock()
}()
go func() {
cond.L.Lock()
cond.Wait()
cond.L.Unlock()
}()
wg.Add(1)
go func() {
wg.Wait()
}()
rwMutex.Lock()
go func() {
rwMutex.RLock()
}()
go func() {
rwMutex.Lock()
}()
log.Println(`Open "http://localhost:6060/debug/pprof/goroutine?debug=2" in your browser.`)
log.Println(http.ListenAndServe(":6060", nil))
}Goroutines viewer needs only one of profiles data, which is goroutine profile in ?debug=2 format.
To get it, run the program and open http://localhost:6060/debug/pprof/goroutine?debug=2 in your browser.