gom

module
Version: v0.0.0-...-183a9e7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 22, 2016 License: Apache-2.0

README

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.

Directories

Path Synopsis
cmd
gom
Package main contains a program that helps to visualize performance-related data from Go programs.
Package main contains a program that helps to visualize performance-related data from Go programs.
internal
commands
Package commands defines and manages the basic pprof commands
Package commands defines and manages the basic pprof commands
driver
Package driver implements the core pprof functionality.
Package driver implements the core pprof functionality.
fetch
Package fetch provides an extensible mechanism to fetch a profile from a data source.
Package fetch provides an extensible mechanism to fetch a profile from a data source.
plugin
Package plugin defines the plugin implementations that the main pprof driver requires.
Package plugin defines the plugin implementations that the main pprof driver requires.
profile
Package profile provides a representation of profile.proto and methods to encode/decode profiles in this format.
Package profile provides a representation of profile.proto and methods to encode/decode profiles in this format.
report
Package report summarizes a performance profile into a human-readable report.
Package report summarizes a performance profile into a human-readable report.
svg
Package svg provides tools related to handling of SVG files
Package svg provides tools related to handling of SVG files
symbolizer
Package symbolizer provides a routine to populate a profile with symbol, file and line number information.
Package symbolizer provides a routine to populate a profile with symbol, file and line number information.
symbolz
Package symbolz symbolizes a profile using the output from the symbolz service.
Package symbolz symbolizes a profile using the output from the symbolz service.
tempfile
Package tempfile provides tools to create and delete temporary files
Package tempfile provides tools to create and delete temporary files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto