Coder Social home page Coder Social logo

yianz / statsviz Goto Github PK

View Code? Open in Web Editor NEW

This project forked from arl/statsviz

0.0 0.0 0.0 2.91 MB

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

License: MIT License

Shell 0.22% Go 87.07% HTML 1.77% JavaScript 10.86% CSS 0.08%

statsviz's Introduction

go.dev reference Go Report Card

Statsviz

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...

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))
}()

The handled path is /debug/statsviz/.

Then open your browser at http://localhost:6060/debug/statsviz/

Examples

Using http.DefaultServeMux:

Using your own http.ServeMux:

Using gorilla/mux Router:

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

Contributing

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

License

statsviz's People

Contributors

arl avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.