Git Product home page Git Product logo

gom's Introduction

gom GoDoc Build Status

A visual interface to work with runtime profiling data from Go programs.

Installation

go get github.com/rakyll/gom/cmd/gom

The program you're willing to profile should import the github.com/rakyll/gom/http package. The http package will register several handlers to provide information about your program during runtime.

import _ "github.com/rakyll/gom/http"

// If your application is not already running an http server,
// you need to start one.
log.Println(http.ListenAndServe("localhost:6060", nil))

If your HTTP server is not going to handle the http.DefaultServeMux, you need to manually register the gom handler to respond to "/debug/_gom".

For example, gorilla/mux users can use the snippet below:

import gomhttp "github.com/rakyll/gom/http"

mux := http.NewServeMux()
mux.HandleFunc("/debug/_gom", gomhttp.Handler())
log.Println(http.ListenAndServe("localhost:6060", nil))

Now, you are ready to launch gom.

$ gom
  • :c loads the CPU profile.
  • :h loads the heap profile (default profile on launch).
  • :r refreshes the current profile.
  • :s toggles the cumulative sort and resorts the items.
  • โ†“ and โ†‘ to paginate.
  • :f=<regex> filters the profile with the provided regex.

Goals

  • Building a lightweight tool that works well with runtime profiles is a necessity. Over the time, I recognized that a lot of people around me delayed to use the existing pprof tools because it's a tedious experience.
  • gom has no ambition to provide the features at the granularity of the features of the command line tools. Users should feel free to fallback to go tool pprof if they need more sophisticated features.
  • Allow users to filter, hide and ignore by symbol names.
  • Increase the awareness around profiling tools and packages in Go.
  • Provide additional lightweight stats where possible.

Minor Goals

  • gom should provide interfaces to let the users to export their profile data and continue to work with the go tool.
  • Allow users to work with their custom user profiles.
  • Make it easier to generate pprof graphical output.

gom's People

Contributors

rakyll avatar parkr avatar

Watchers

 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.