All Projects → arl → Statsviz

arl / Statsviz

Licence: mit
🚀 Instant live visualization of your Go application runtime statistics (GC, MemStats, etc.) in the browser

Programming Languages

javascript
184084 projects - #8 most used programming language
go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Statsviz

Opencensus Node
A stats collection and distributed tracing framework
Stars: ✭ 249 (-75.47%)
Mutual labels:  monitoring, metrics, stats
Opencensus Web
A stats collection and distributed tracing framework
Stars: ✭ 168 (-83.45%)
Mutual labels:  monitoring, metrics, stats
Opencensus Csharp
Distributed tracing and stats collecting framework
Stars: ✭ 126 (-87.59%)
Mutual labels:  monitoring, metrics, stats
Opencensus Java
A stats collection and distributed tracing framework
Stars: ✭ 640 (-36.95%)
Mutual labels:  monitoring, metrics, stats
Gin Stats
Gin's middleware for request stats
Stars: ✭ 24 (-97.64%)
Mutual labels:  metrics, stats
Logmonitor
Monitoring log files on windows systems.
Stars: ✭ 23 (-97.73%)
Mutual labels:  monitoring, metrics
App
Just a little analytics insight for your personal or indie project
Stars: ✭ 40 (-96.06%)
Mutual labels:  metrics, stats
Appmetrics
Node Application Metrics provides a foundational infrastructure for collecting resource and performance monitoring data for Node.js-based applications.
Stars: ✭ 864 (-14.88%)
Mutual labels:  monitoring, metrics
Prometheus
Kubernetes Setup for Prometheus and Grafana
Stars: ✭ 824 (-18.82%)
Mutual labels:  monitoring, metrics
Devdash
🍱 Highly Configurable Terminal Dashboard for Developers and Creators
Stars: ✭ 939 (-7.49%)
Mutual labels:  monitoring, metrics
Sensu Plugins Process Checks
This plugin provides native process instrumentation for monitoring and metrics collection, including: process status, uptime, thread count, and others.
Stars: ✭ 20 (-98.03%)
Mutual labels:  monitoring, metrics
Wobserver
Web based metrics, monitoring, and observer
Stars: ✭ 900 (-11.33%)
Mutual labels:  monitoring, metrics
Graylog Plugin Metrics
Graylog output plugin for Graphite and Ganglia
Stars: ✭ 16 (-98.42%)
Mutual labels:  monitoring, metrics
Postgresql exporter
A Prometheus exporter for some postgresql metrics
Stars: ✭ 26 (-97.44%)
Mutual labels:  monitoring, metrics
Django Prometheus
Export Django monitoring metrics for Prometheus.io
Stars: ✭ 823 (-18.92%)
Mutual labels:  monitoring, metrics
Spm Agent Mongodb
Sematext Agent for monitoring MongoDB
Stars: ✭ 7 (-99.31%)
Mutual labels:  monitoring, metrics
Prometheus Net
.NET library to instrument your code with Prometheus metrics
Stars: ✭ 944 (-7%)
Mutual labels:  monitoring, metrics
Sensu Plugins Network Checks
This plugin provides native network instrumentation for monitoring and metrics collection, including: hardware, TCP response, RBLs, whois, port status, and more.
Stars: ✭ 28 (-97.24%)
Mutual labels:  monitoring, metrics
Pgwatch2
PostgreSQL metrics monitor/dashboard
Stars: ✭ 960 (-5.42%)
Mutual labels:  monitoring, metrics
Nginx Lua Prometheus
Prometheus metric library for Nginx written in Lua
Stars: ✭ 964 (-5.02%)
Mutual labels:  monitoring, metrics

go.dev reference Test Actions Status Go Report Card codecov

Statsviz

Instant live visualization of your Go application runtime statistics (GC, MemStats, etc.).

  • Import "github.com/arl/statsviz"
  • Register statsviz HTTP handlers
  • Start your program
  • Open your browser at http://host:port/debug/statsviz
  • Enjoy...

How does it work?

Statsviz serves 2 HTTP handlers.

The first one (by default /debug/statsviz) serves an html/js user interface showing some initially empty plots.

When you points your browser to statsviz user interface page, it connects to statsviz second HTTP handler. This second handler then upgrades the connection to the websocket protocol and starts a goroutine that periodically calls runtime.ReadMemStats, sending the result to the user interface, which inturn, updates the plots.

Stats are stored in-browser inside a circular buffer which keep tracks of a predefined number of datapoints, 60, so one minute-worth of data, by default. You can change the frequency at which stats are sent by passing SendFrequency to Register.

Usage

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/

Plots

On the plots where it matters, garbage collections are shown as vertical lines.

Heap

Heap plot image

MSpans / MCaches

MSpan/MCache plot image

Size classes heatmap

Size classes heatmap image

Objects

Objects plot image

Goroutines

Goroutines plot image

GC/CPU fraction

GC/CPU fraction plot image

Examples

Using http.DefaultServeMux:

Using your own http.ServeMux:

Serve statsviz on /foo/bar instead of default /debug/statsviz:

Serve on https (and wss for websocket):

With gorilla/mux router:

Using labstack/echo router:

With gin-gonic/gin web framework:

With go-chi/chi router:

Contributing

Pull-requests are welcome! More details in CONTRIBUTING.md

Roadmap

  • [ ] add stop-the-world duration heatmap
  • [ ] increase data retention
  • [ ] light/dark mode selector
  • [x] plot image export as png
  • [ ] save timeseries to disk
  • [ ] load from disk previously saved timeseries

Changelog

See CHANGELOG.md.

License

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].