Git Product home page Git Product logo

grmon's Introduction

grmon

Command line monitoring for goroutines

grmon

Install

go get -u github.com/bcicen/grmon

Usage

Simply import and call grmon.Start() somewhere in your code:

import "github.com/bcicen/grmon/agent"
...
grmon.Start()

alternatively, you may just start the pprof server directly:

import (
	"net/http"
	_ "net/http/pprof"
)
...
go http.ListenAndServe(":1234", nil)

now grmon can connect to the running program:

grmon

By default, grmon will automatically refresh every 5s. Pause automatic refresh(p) to enable the cursor and expand the full trace for a selected goroutine(<enter>).

Keybindings

Key Action
r manually refresh
p pause/unpause automatic updates
s toggle sort column and refresh
f filter by keyword
<up>,<down>,j,k move cursor position
<enter>,o expand trace under cursor
t open trace in full screen mode
q exit grmon

Options

Option Description Default
-i time in seconds between refresh, 0 to disable 5
-host target host localhost:1234
-endpoint target endpoint path /debug/pprof

Roadmap

  • Hierarchal/tree display

grmon's People

Contributors

bcicen avatar kevinschoon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

grmon's Issues

Just an idiomatic thought.

My first impulse (right after, I could have really used this 3 weeks ago lol) is to "Yuck dep" but instead...

if you put cli in cmd/grmon

One could simply

go get github.com/bcicen/grmon
go install github.com/bcicen/grmon/cmd/grmon

No make or dep required (turns out I don't have dep installed, and I'm happy with that state of affairs ๐Ÿ˜ )

You could still have a makefile and use dep, but the cmd/executable is more idiomatic

movement keys aren't working

Possibly a terminal mismatch issue, not sure yet, but the movement keys aren't working for me. I can hit 't' and get the trace for the item, but I can't really see which item I've selected.

Neat tool!

error occured when make install

Platform: mac os
Terminal: Iterm2
Error Msg:

% make install                                                                    
make build
dep ensure
make[1]: dep: No such file or directory
make[1]: *** [build] Error 1
make: *** [install] Error 2

invalid memory address or nil pointer dereference

When running grmon I'm getting this error. Any ideas why this is happening?

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0x1385f7c]

goroutine 1 [running]:
main.ReadRoutines(0xc000228000, 0xa1, 0x200, 0x10, 0xff, 0x0, 0x0, 0x0)
	/Users/me/go/src/github.com/bcicen/grmon/parse.go:76 +0x19c
main.poll(0x105a2f0, 0x0, 0xc0000f9ec0, 0xc0001ae000, 0x0)
	/Users/me/go/src/github.com/bcicen/grmon/client.go:38 +0x17c
main.Refresh()
	/Users/me/go/src/github.com/bcicen/grmon/main.go:38 +0x26
main.main()
	/Users/me/go/src/github.com/bcicen/grmon/main.go:202 +0xe7

Why the github.com/bcicen/grmon import?

Why can't grmon not just parse the output of /debug/pprof/goroutine?debug=1?

This would make things a lot easier as the program you want to monitor doesn't have to add another dependency.

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.