memplot

package module
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2020 License: GPL-3.0 Imports: 8 Imported by: 0

README

memplot

A small utility written in golang to quickly plot memory usage of processes. Still in a very early stage. memplot constantly samples memory usage of a process, for a given duration of time and then outputs a .png file. Painless and straightforward.

Installation

go get -u -v github.com/0x0f0f0f/memplot/cmd

Usage

Usage of memplot:
  -dur duration
    	total profiling time (default 10s)
  -pid int
    	pid of the process to analyze (default -1)
  -sd duration
    	sample size in time (default 5ms)
  -vsz
    	plot virtual size

Example Plot

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SavePlot

func SavePlot(p *plot.Plot, width, height vg.Length, filename string) error

Types

type MemoryCollection

type MemoryCollection struct {
	Pid            int32
	StartTime      time.Time
	SampleDuration time.Duration // Time between samples
	Samples        []MemoryInstant
}

func NewMemoryCollection

func NewMemoryCollection(pid int32, sd, duration time.Duration) (*MemoryCollection, error)

Gather a process resident size in memory in batch

func (*MemoryCollection) GatherRSSXYs

func (m *MemoryCollection) GatherRSSXYs() plotter.XYs

Gather RSS points from a memory collection

func (*MemoryCollection) GatherVSZXYs

func (m *MemoryCollection) GatherVSZXYs() plotter.XYs

Gather VSZ points from a memory collection

func (*MemoryCollection) Plot

func (m *MemoryCollection) Plot(opt PlotOptions) (*plot.Plot, error)

Plot a memory collection

type MemoryInstant

type MemoryInstant struct {
	MemoryInfo *process.MemoryInfoStat
	Instant    time.Duration
}

Memory data for a given instant

type PlotOptions

type PlotOptions struct {
	PlotRss bool
	PlotVsz bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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