Coder Social home page Coder Social logo

gosivy's Introduction

gosivy

Release go.dev reference

Another visualization tool for Go process metrics.

Demo

Gosivy tracks Go process's metrics and plot their evolution over time right into your terminal, no matter where it's running on. It helps you understand how your application consumes the resources.

Installation

Binary releases are available through here.

MacOS

brew install nakabonne/gosivy/gosivy

RHEL/CentOS

rpm -ivh https://github.com/nakabonne/gosivy/releases/download/v0.2.0/gosivy_0.2.0_linux_$(dpkg --print-architecture).rpm

Debian/Ubuntu

wget https://github.com/nakabonne/gosivy/releases/download/v0.2.0/gosivy_0.2.0_linux_$(dpkg --print-architecture).deb
apt install ./gosivy_0.2.0_linux_$(dpkg --print-architecture).deb

Go

Required: >= 1.10

go get github.com/nakabonne/gosivy

Quickstart

Unsure if Gosivy is for you? Watch Gosivy by using the example application.

Run the example application:

git clone https://github.com/nakabonne/gosivy.git && cd gosivy
go run examples/local/main.go

Then simply perform gosivy with no arguments (it automatically finds the process where the agent runs on):

gosivy

Press q to quit.

Usage

First up, you start the agent in the process where you want to collect statistics. Then execute gosivy to scrape from the agent periodically. You can diagnose processes running not only locally (local mode), but also on another host (remote mode).

Local Mode

Import github.com/nakabonne/gosivy/agent into the target application to launch the agent. See the local example.

package main

import "github.com/nakabonne/gosivy/agent"

func main() {
	if err := agent.Listen(agent.Options{}); err != nil {
		panic(err)
	}
	defer agent.Close()
}

With -l flag can list the processes where the agent runs on:

$ gosivy -l
PID   Exec Path
15788 foo  /path/to/foo

Give the PID of the process to be diagnosed:

$ gosivy 15788

Be sure to start the gosivy process as the same user as the target application.

Remote Mode

Give the address the agent listens on:

package main

import "github.com/nakabonne/gosivy/agent"

func main() {
	err := agent.Listen(agent.Options{
		Addr: ":9090",
	})
	if err != nil {
		panic(err)
	}
	defer agent.Close()
}

Specify the target's agent address accessible by the host where gosivy will be executed:

$ gosivy host.xz:9090

Settings

Command-line options are:

Usage:
  gosivy [flags] <pid|host:port>

Flags:
      --debug                      Run in debug mode.
  -l, --list-processes             Show processes where gosivy agent runs on.
      --scrape-interval duration   Interval to scrape from the agent. It must be >= 1s (default 1s)
  -v, --version                    Print the current version.

Gosivy requires the config directory for pid management. By default it will be created undernearth $HOME/.config (APPDATA on windows). For those who want to assign another directory, GOSIVY_CONFIG_DIR environment variable is available.

Features

  • Simple - Show only minimal metrics.
  • Pull-based monitoring - The agent is designed to just listen on, so the target process does nothing unless you issue a request.
  • Wherever it's running on - Any process can be diagnosed as long as you can access the TCP socket the agent opens.

Supported Architectures

The architectures the agent can perform on are:

  • Darwin i386/amd64
  • Linux i386/amd64/arm(raspberry pi)
  • FreeBSD i386/amd64/arm
  • Windows/amd64
  • OpenBSD amd64
  • Solaris amd64

Those partially supported:

  • CPU on DragonFly BSD
  • host on Linux RISC-V

Built With

Inspired By

Author

Ryo Nakao <[email protected]>

gosivy's People

Contributors

nakabonne avatar tarasovych 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.