graph

package module
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2020 License: MIT Imports: 11 Imported by: 0

README

dstat-graph

MIT License GoDoc Go Report Card Releases

generate png chart from dstat CSV file.
data visualization using go-chart
(inspired by dstat2graph)

cpu
net

Usage

output dstat csv using dstat --output

$ dstat -t --cpu --mem --disk --io --net --int --sys --tcp --output ./dstat.csv

load csv into dstat-graph (column filter with -f if necessary)

$ dstat-graph --csv ./dstat.csv -o cpu.png -f usr,sys,idl,wai

see more examples.

Download

Linux amd64 / Darwin amd64 binaries are available in Releases

Build

Build requires Go version 1.11+ installed.

$ go version

Run make pkg to Build and package for linux, darwin.

$ git clone https://github.com/octu0/dstat-graph
$ make pkg

Help

NAME:
   dstat-graph

USAGE:
   dstat-graph [global options] command [command options] [arguments...]

VERSION:
   1.0.0

COMMANDS:
     help, h  Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --csv value, -i value     /path/to/csv dstat csv path
   --out value, -o value     output file path (if argument is empty, write to tmpfile for parse test)
   --column value, -f value  pickup columns (defaults: plot all columns)
   --chart value, -t value   chart-type 'line' or 'bar' (defaults: 'line') (default: "line")
   --width value             image width (default: 600)
   --height value            image height (default: 400)
   --debug, -d               debug mode
   --verbose, -V             verbose. more message
   --help, -h                show help
   --version, -v             print the version

Documentation

Index

Constants

View Source
const (
	AppName string = "dstat-graph"
	Version string = "1.0.2"
	UA      string = AppName + "/" + Version
)

Variables

This section is empty.

Functions

func RenderToFile added in v1.0.2

func RenderToFile(graph chart.Chart, out io.Writer) error

Types

type Chart

type Chart interface {
	Read(io.Reader) (chart.Chart, error)
}

type DstatCSVRow

type DstatCSVRow struct {
	Time   time.Time
	Values DstatRecord
}

func Parse

func Parse(r io.Reader) ([]string, []DstatCSVRow, error)

type DstatRecord

type DstatRecord map[string]float64

type LineChart

type LineChart struct {
	// contains filtered or unexported fields
}

func NewLineChart

func NewLineChart(columns []string, width, height int) *LineChart

func (*LineChart) Read

func (c *LineChart) Read(r io.Reader) (chart.Chart, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL