Giter VIP home page Giter VIP logo

goprofui's Introduction

goprofui

A simple package for profiling deployed binaries.

Key features:

  • Does not require running any other scripts/tools, only the binary under monitoring.
  • Flame graphs for stack trace profiling.
  • Memory, GC pauses and goroutines line charts.

Related Work

  • go-torch. https://github.com/uber/go-torch. go-torch does cpu profiling and represents it as a flame graph. We were directly inspired by this package. In contrast to goprofui, go-torch requires the go pprof tool and an external Perl script.

  • profile. https://github.com/pkg/profile. profile does cpu and memory profiling, and saves them into a file. It is easy to setup and use. However, the cpu profiles would have to be further parsed for a flame graph.

  • flame graphs. http://www.brendangregg.com/flamegraphs.html. Created by Brendan Gregg. An extremely succinct way to summarize stack traces.

Installation

go get github.com/wirelessregistry/goprofui

Dependencies

  1. Requires the net web-socket library https://godoc.org/golang.org/x/net/websocket.

  2. The flame graph JS library is https://github.com/spiermar/d3-flame-graph.

  3. The line chart JS library is D3's.

  4. goprofui's internal package is forked from pprof's internal package. It is covered by the BSD-license in LICENSE_internal_pkg.

Usage and Code Structure

The quickest way to get started is to copy the handlers' setup from examples/web/web.go. Build the web.go application, and then serve the index.html file using a web server (https://github.com/indexzero/http-server for example).

When you visit the example using your web browser, you will see some graphs:

  • Alt text
  • Alt text
  • Alt text

The cpu profiling code is in cpu.go. The memory, GC latency and goroutines stats are obtained in tickerHandlers.go.

goprofui's People

Contributors

a-little-srdjan avatar julia-allyce avatar

Watchers

James Cloos avatar Jason Xu 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.