Visualise Go program GC trace data in real time


This project is no longer maintained

I'm sorry but I do not have the bandwidth to maintain this tool. Please do not send issues or PRs. Thank you.


gcvis

Visualise Go program gctrace data in real time

Note: GC timing graphs are only supported for go 1.6

Usage

Running it directly:

env GOMAXPROCS=4 gcvis godoc -index -http=:6060

Adding the gctrace flag yourself:

GODEBUG=gctrace=1 godoc -index -http=:6060 2>&1 | gcvis

Or from a log file:

GODEBUG=gctrace=1 godoc -index -http=:6060 2> stderr.log
cat stderr.log | gcvis

Starting the server without automatically opening a browser:

gcvis -o=false godoc -index -http=:6060
Comments
  • Go 1.5 support + Refactor

    Go 1.5 support + Refactor

    I fixed the regexp for Go 1.5 as explained on https://golang.org/pkg/runtime/

    Currently, it is: gc # @#s #%: #+...+# ms clock, #+...+# ms cpu, #->#-># MB, # MB goal, # P

    I ended up also adding tests and fixing a few things:

    • It was parsing Stderr and printing on Stdout (via Println). It now always write to Stderr.
    • I added a flag to be able to set a fixed port.
  • Fix break in main loop

    Fix break in main loop

    When the parser signals that it is done, the main loop wants to exit, but the break for the for loop was only breaking the select case and not the loop.

    Before this patch, if the input was closed (for example when we pipe into gcvis and the process on the left was done) gcvis would always go into the done case, just break the case and then continue to the next iteration of the loop, which would again choose the done case and continue like this forever, eating up a single CPU core (effectively busy looping).

    Fix this by replacing the break with os.Exit(0).

  • Add timings

    Add timings

    I wanted to get insights in the GC timings so I extended gcvis to also parse out the timing measurements and show them. note: i just modified the regex for go 1.5, but only tested it with 1.6, not sure if these versions use an identical format? screenshots (note: program instrumented had very few scavenger runs) BEFORE: old AFTER: new

  • Refactor

    Refactor

    So I was looking at gcvis and noticed that it didn't work with my app... So I dug into it and found out that when I use goroutines it would show nothing.

    I ended up noticing a previous PR https://github.com/davecheney/gcvis/pull/9 on your repository but which was causing previous output to not be parsed anymore. At this point, I decided to just add tests on the project (at least on the Parser part).

    I couldn't help but also refactor the whole main.go file to make a bit more sense of it and get to write only tests on the Parser part.

    A bit of cleanup is still necessary IMO, but I'll get to that later. Would you be okay to review/merge this PR?

  • Fix template import

    Fix template import

    The javascript is currently broken.

    This one is on me :disappointed:. When I refactored I was still running the old gcvis executable in my GOPATH. Turns out goimports added this dependency thinking it was a text/template when in fact we used html/template before.

    Sorry about that. I wish I could have a bit of time to add tests around the http server but that'll have to wait a bit.

  • Use regexp to match stdout instead of fmt.Sscanf

    Use regexp to match stdout instead of fmt.Sscanf

    This allows us to match on goroutines conditionally and still support go versions inferior to 1.4.

    If you could review/merge this one, then I could rebase my other PR on top of master to fix the timeout issue everywhere.

    Cheers.

  • Stdin support

    Stdin support

    Work in progress.

    This PR introduces the possibility of running gcvis with the content of Stdin.

    @davecheney if you have any advice on adding integration tests on the CLI, I'm all ears :smile:.

  • Fix timeout issue

    Fix timeout issue

    timeoutAfter would make other tests cases fail if they took more than the duration passed in parameter. Each test now creates its own timeout channel, avoiding shared state between tests.

    @davecheney You told me to add the timeout in runParserWith but I feel that placing it in timeoutAfter makes more sense.

  • gcvis/main.go

    gcvis/main.go

    Issue: When using pipe call scheme (not a subcommand one), title of the page was not being set properly (it was rendered as gcvis -)

    Here I suggest setting it to iface:port in such cases (eg. for localhost:6060 the page title would render as gcvis - localhost:6060)

  • Add accumulated totals, the lazy way

    Add accumulated totals, the lazy way

    I wanted to see accumulated totals. This isn't ideal from a memory POV, but it got me the data I needed.

    Also refactored the JS a bit, seems to work.

  • Containerize the runtime events in a ring buffer.

    Containerize the runtime events in a ring buffer.

    To enable someone to use this tool to observe event streams over sliding windows of sample recency as well as prevent unbound growth of observations, the list of observations has been wrapped in a ring buffer of flag-specifiable size. This has been a tremendous help in visualizing events from particularly garbage collector-active servers.

  • Allow the ability to save the graph.

    Allow the ability to save the graph.

    This is a PR to fix #1, there are some limitations outlined bellow and I'll see if I can fix the transparent image later on.

    Limitations: Currently FF saves with incorrect image extension and the background of the image is transparent (will fix later).

Related tags
This static analysis tool works to ensure your program's data flow does not spill beyond its banks.

Go Flow Levee This static analysis tool works to ensure your program's data flow does not spill beyond its banks. An input program's data flow is expl

Dec 1, 2022
octocov is a tool for collecting code metrics (code coverage, code to test ratio and test execution time).

octocov is a tool for collecting code metrics (code coverage, code to test ratio and test execution time).

Jan 9, 2023
Drone Plugin for detecting credentials or other sensitive data in your repository

A plugin to detect hard-coded secrets and sensitive data in your source code files. Building Build the plugin binary: scripts/build.sh Build the plug

Apr 21, 2022
Marshal data into commands struct!
Marshal data into commands struct!

Commandarrgh in a nuthsell Commandarrgh is an interface that helps you marshaling data into a command arguments structure. Maybe you have been trying

Dec 18, 2021
Visualise Go program GC trace data in real time

This project is no longer maintained I'm sorry but I do not have the bandwidth to maintain this tool. Please do not send issues or PRs. Thank you. gcv

Dec 14, 2022
PinGo is a standalone and feature-rich tool for common IP-based reachability checking tasks. Ping or Trace and Observe in real-time the statistics.

pingo As a network champion from designing and implementing to troubleshooting large scale networks - I know that is usually not easy for administrato

Sep 26, 2022
Real-time Map displays real-time positions of public transport vehicles in Helsinki
Real-time Map displays real-time positions of public transport vehicles in Helsinki

Real-time Map Real-time Map displays real-time positions of public transport vehicles in Helsinki. It's a showcase for Proto.Actor - an ultra-fast dis

Nov 30, 2022
Simple TCP proxy to visualise NATS client/server traffic
Simple TCP proxy to visualise NATS client/server traffic

NATS uses a simple publish/subscribe style plain-text protocol to communicate between a NATS Server and its clients. Whilst this connection should remain opaque to the user, it can be quite handy to see the data being passed from time to time - this tool does just that (it also saves me loading Wireshark and filtering the NATS traffic).

Jan 15, 2022
A LoRaWAN nodes' and network simulator that works with a real LoRaWAN environment (such as Chirpstack) and equipped with a web interface for real-time interaction.
A LoRaWAN nodes' and network simulator that works with a real LoRaWAN environment (such as Chirpstack) and equipped with a web interface for real-time interaction.

LWN Simulator A LoRaWAN nodes' simulator to simulate a LoRaWAN Network. Table of Contents General Info Requirements Installation General Info LWN Simu

Nov 20, 2022
Simple and easy to use client for stock market, forex and crypto data from finnhub.io written in Go. Access real-time financial market data from 60+ stock exchanges, 10 forex brokers, and 15+ crypto exchanges

go-finnhub Simple and easy to use client for stock, forex and crpyto data from finnhub.io written in Go. Access real-time market data from 60+ stock e

Dec 28, 2022
Trace Go program execution with uprobes and eBPF
Trace Go program execution with uprobes and eBPF

Weaver PLEASE READ! - I am currently refactoring Weaver to use libbpf instead of bcc which would include various other major improvements. If you're c

Dec 28, 2022
Reduce debugging time while programming Go. Use static and stack-trace analysis to determine which func call causes the error.
Reduce debugging time while programming Go. Use static and stack-trace analysis to determine which func call causes the error.

Errlog: reduce debugging time while programming Introduction Use errlog to improve error logging and speed up debugging while you create amazing code

Nov 18, 2022
Fast specialized time-series database for IoT, real-time internet connected devices and AI analytics.
Fast specialized time-series database for IoT, real-time internet connected devices and AI analytics.

unitdb Unitdb is blazing fast specialized time-series database for microservices, IoT, and realtime internet connected devices. As Unitdb satisfy the

Jan 1, 2023
nanoQ — high-performance brokerless Pub/Sub for streaming real-time data

nanoQ — high-performance brokerless Pub/Sub for streaming real-time data nanoQ is a very minimalistic (opinionated/limited) Pub/Sub transport library.

Nov 9, 2022
Get any cryptocurrencies ticker and trade data in real time from multiple exchanges and then save it in multiple storage systems.
Get any cryptocurrencies ticker and trade data in real time from multiple exchanges and then save it in multiple storage systems.

Cryptogalaxy is an app which will get any cryptocurrencies ticker and trade data in real time from multiple exchanges and then saves it in multiple storage systems.

Jan 4, 2023
A simple go application that uses Youtube Data API V3 to show the real-time stats for a youtube channel such as the subs, views, avg. earnings etc.
A simple go application that uses Youtube Data API V3 to show the real-time stats for a youtube channel such as the subs, views, avg. earnings etc.

Youtube-channel-monitor A simple go application that uses Youtube Data API V3 to show the real-time stats for a youtube channel such as the subs, view

Dec 30, 2021
Time-Based One-Time Password (TOTP) and HMAC-Based One-Time Password (HOTP) library for Go.

otpgo HMAC-Based and Time-Based One-Time Password (HOTP and TOTP) library for Go. Implements RFC 4226 and RFC 6238. Contents Supported Operations Read

Dec 19, 2022
Time struct in Go that uses 4 bytes of memory vs the 24 bytes of time.Time

A tiny time object in Go. Tinytime uses 4 bytes of memory vs the 24 bytes of a standard time.Time{}

Oct 3, 2022
eris provides a better way to handle, trace, and log errors in Go 🎆

eris Package eris provides a better way to handle, trace, and log errors in Go. go get github.com/rotisserie/eris Why you'll want to switch to eris Us

Dec 29, 2022
Golang errors with stack trace and source fragments.
Golang errors with stack trace and source fragments.

Golang Errors with Stack Trace and Source Fragments Tired of uninformative error output? Probably this will be more convenient: Example package main

Dec 17, 2022