Security News
Opengrep Emerges as Open Source Alternative Amid Semgrep Licensing Controversy
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
github.com/arl/statsviz
Visualize real time plots of your Go program runtime metrics, including heap, objects, goroutines, GC pauses, scheduler and more, in your browser.
Download the latest version:
go get github.com/arl/statsviz@latest
Please note that, as new metrics are added to the /runtime/metrics
package, new plots are added to Statsviz.
This also means that the presence of some plots on the dashboard depends on the Go version you're using.
When in doubt, use the latest ;-)
Register Statsviz
HTTP handlers with your application http.ServeMux
.
mux := http.NewServeMux()
statsviz.Register(mux)
go func() {
log.Println(http.ListenAndServe("localhost:8080", mux))
}()
Open your browser at http://localhost:8080/debug/statsviz
If you want more control over Statsviz HTTP handlers, examples are:
then use statsviz.NewServer
to obtain a Server
instance. Both the Index()
and Ws()
methods return http.HandlerFunc
.
srv, err := statsviz.NewServer(); // Create server or handle error
srv.Index() // UI (dashboard) http.HandlerFunc
srv.Ws() // Websocket http.HandlerFunc
Please look at examples of usage in the Examples directory.
statsviz.Register
registers 2 HTTP handlers within the given http.ServeMux
:
the Index
handler serves Statsviz user interface at /debug/statsviz
at the address served by your program.
The Ws
serves a Websocket endpoint. When the browser connects to that endpoint, runtime/metrics are sent to the browser, once per second.
Data points are in a browser-side circular-buffer.
Check out the API reference on pkg.go.dev.
Controls at the top of the page act on all plots:
On top of each plot there are 2 icons:
Depending on your go version, some plots may not be available.
Since v0.6
you can add your own plots to Statsviz dashboard, in order to easily
visualize your application metrics next to runtime metrics.
Please see the userplots example.
Check out the _example directory to see various ways to use Statsviz, such as:
http.DefaultServeMux
or your own http.ServeMux
/foo/bar
instead of /debug/statsviz
https://
rather than http://
Either use GitHub's discussions or come to say hi and ask a live question on #statsviz channel on Gopher's slack.
Please use issues for bugs and feature requests.
Pull-requests are always welcome!
More details in CONTRIBUTING.md.
See CHANGELOG.md.
See LICENSE
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.