Instant live visualization of your Go application runtime statistics (GC, MemStats, etc.).
- Import
import "github.com/arl/statsviz"
- Register statsviz HTTP handlers
- Start your program
- Open your browser at
http://host:port/debug/statsviz
- Enjoy...
go get -u github.com/arl/statsviz
Either Register
statsviz HTTP handlers with the http.ServeMux you're using (preferred method):
mux := http.NewServeMux()
statsviz.Register(mux)
Or register them with the http.DefaultServeMux
:
statsviz.RegisterDefault()
If your application is not already running an HTTP server, you need to start
one. Add "net/http"
and "log"
to your imports and the following code to your
main
function:
go func() {
log.Println(http.ListenAndServe("localhost:6060", nil))
}()
By default the handled path is /debug/statsviz/
.
Then open your browser at http://localhost:6060/debug/statsviz/
Using http.DefaultServeMux
:
Using your own http.ServeMux
:
Using gorilla/mux Router:
On the plots where it matters, garbage collections are shown as vertical lines.
Pull-requests are welcome! More details in CONTRIBUTING.md
- add stop-the-world duration heatmap
- increase data retention
- light/dark mode selector
- plot image export
-
v0.1.1 / 2020-10-12
- Bugfix: do not leak timer in sendStats
-
v0.1.0 / 2020-10-10
- First released version