Command line monitoring for goroutines

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
Owner
bradley
Prototyping from the corner deli.
bradley
Comments
  • movement keys aren't working

    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!

  • Why the github.com/bcicen/grmon import?

    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.

  • Just an idiomatic thought.

    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

  • invalid memory address or nil pointer dereference

    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
    
  • error occured when make install

    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
    
  • Under macos iterm2 there is no highlight on selecting goroutine.

    Under macos iterm2 there is no highlight on selecting goroutine.

    Using macos iterm2 with grmon latest, but there is no hightlighting for selected goroutine.

    Besides that everything works great, and I managed to find a goroutine leak after using grmon for 3 minutes.

    Great tool!

  • update termbox-go dependency

    update termbox-go dependency

    This updates the termbox-go dependency to the current head of master. It fixes a bug in termbox-go caused by ncurses 6.1 on Linux which makes grmon unusable.

    To reproduce the issue you can upgrade to ncurses 6.1 and run grmon.

An open-source GitLab command line tool bringing GitLab's cool features to your command line
An open-source GitLab command line tool bringing GitLab's cool features to your command line

GLab is an open source GitLab CLI tool bringing GitLab to your terminal next to where you are already working with git and your code without switching

Dec 30, 2022
A command line tool that builds and (re)starts your web application everytime you save a Go or template fileA command line tool that builds and (re)starts your web application everytime you save a Go or template file

# Fresh Fresh is a command line tool that builds and (re)starts your web application everytime you save a Go or template file. If the web framework yo

Nov 22, 2021
A command line tool to prompt for a value to be included in another command line.

readval is a command line tool which is designed for one specific purpose—to prompt for a value to be included in another command line. readval prints

Dec 22, 2021
Go package to make lightweight ASCII line graph ╭┈╯ in command line apps with no other dependencies.
Go package to make lightweight ASCII line graph ╭┈╯ in command line apps with no other dependencies.

asciigraph Go package to make lightweight ASCII line graphs ╭┈╯. Installation go get github.com/guptarohit/asciigraph Usage Basic graph package main

Jan 8, 2023
git-xargs is a command-line tool (CLI) for making updates across multiple Github repositories with a single command.
git-xargs is a command-line tool (CLI) for making updates across multiple Github repositories with a single command.

Table of contents Introduction Reference Contributing Introduction Overview git-xargs is a command-line tool (CLI) for making updates across multiple

Dec 31, 2022
git-xargs is a command-line tool (CLI) for making updates across multiple GitHub repositories with a single command
git-xargs is a command-line tool (CLI) for making updates across multiple GitHub repositories with a single command

git-xargs is a command-line tool (CLI) for making updates across multiple GitHub repositories with a single command. You give git-xargs:

Feb 5, 2022
Package command provide simple API to create modern command-line interface

Package command Package command provide simple API to create modern command-line interface, mainly for lightweight usage, inspired by cobra Usage pack

Jan 16, 2022
A command line tool for simplified docker volume command built with go

dockervol A command line tool for simplified docker volume command built with go. Features: Remove anonymous volume (beta) Remove volume by matching n

Dec 18, 2021
Watcher - A simple command line app to watch files in a directory for changes and run a command when files change!

Watcher - Develop your programs easily Watcher watches all the files present in the directory it is run from of the directory that is specified while

Mar 27, 2022
Console-based JVM monitoring tool
Console-based JVM monitoring tool

jvm-mon Console based JVM monitoring - when you just want to SSH into a server and see what's going on. jvm-top lets you monitor your JVM server appli

Jan 2, 2023
LINE account link: Sample code for LINE account link
LINE account link: Sample code for LINE account link

LINE account link: Sample code for LINE account link This is sample code to demostration LINE chatbot account link, refer to document https://develope

Dec 11, 2021
argv - Go library to split command line string as arguments array using the bash syntax.

Argv Argv is a library for Go to split command line string into arguments array. Documentation Documentation can be found at Godoc Example func TestAr

Nov 19, 2022
CLI - A package for building command line app with go
CLI - A package for building command line app with go

Command line interface Screenshot Key features Lightweight and easy to use. Defines flag by tag, e.g. flag name(short or/and long), description, defau

Dec 23, 2022
Simple and complete API for building command line applications in Go

Simple and complete API for building command line applications in Go Module cli provides a simple, fast and complete API for building command line app

Nov 23, 2022
Golang library with POSIX-compliant command-line UI (CLI) and Hierarchical-configuration. Better substitute for stdlib flag.
Golang library with POSIX-compliant command-line UI (CLI) and Hierarchical-configuration. Better substitute for stdlib flag.

cmdr cmdr is a POSIX-compliant, command-line UI (CLI) library in Golang. It is a getopt-like parser of command-line options, be compatible with the ge

Oct 28, 2022
Automatically sets up command line flags based on struct fields and tags.
Automatically sets up command line flags based on struct fields and tags.

Commandeer Commandeer sets up command line flags based on struct fields and tags. Do you... like to develop Go apps as libraries with tiny main packag

Dec 1, 2022
A simple command line notebook for programmers
A simple command line notebook for programmers

Dnote is a simple command line notebook for programmers. It keeps you focused by providing a way of effortlessly capturing and retrieving information

Jan 2, 2023
Flag is a simple but powerful command line option parsing library for Go support infinite level subcommand

Flag Flag is a simple but powerful commandline flag parsing library for Go. Documentation Documentation can be found at Godoc Supported features bool

Sep 26, 2022
go command line option parser

go-flags: a go library for parsing command line arguments This library provides similar functionality to the builtin flag library of go, but provides

Jan 4, 2023