plot

package
v0.0.0-...-4705b87 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package plot is a modified version of Package plot is a modified version of the github.com/tsenart/vegeta/lib/plot package. It removes the `WriteTo()` function contained in the original library and replaces it a `GetData()` function.

Package plot is a modified version of the plotting functionality exposed by in the Vegeta library: https://github.com/tsenart/vegeta/blob/d73edf2bc2663d83848da2a97a8401a7ed1440bc/lib/plot/timeseries.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorLabeler

func ErrorLabeler(r *vegeta.Result) (label string)

ErrorLabeler is an HTMLPlotLabeler which labels a result with an OK or ERROR label based on whether it has an error set.

Types

type Labeler

type Labeler func(*vegeta.Result) (label string)

An Labeler is a function that returns a label to partition and represent Results in separate (but overlaid) line charts in the rendered plot.

type Opt

type Opt func(*Plot)

Opt is a functional option type for Plot.

func Downsample

func Downsample(threshold int) Opt

Downsample returns an Opt that enables downsampling to the given threshold number of data points per labeled series.

func Label

func Label(l Labeler) Opt

Label returns an Opt that sets the given Labeler to be used to partition results into multiple overlaid line charts.

func Title

func Title(title string) Opt

Title returns an Opt that sets the title of a Plot.

type Plot

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

An Plot represents an interactive HTML time series plot of Result latencies over time.

func New

func New(opts ...Opt) *Plot

New returns a Plot with the given Opts applied. If no Label opt is given, ErrorLabeler will be used as default.

func (*Plot) Add

func (p *Plot) Add(r *vegeta.Result) error

Add adds the given Result to the Plot time series.

func (*Plot) Close

func (p *Plot) Close()

Close closes the HTML plot for writing.

func (Plot) GetData

func (p Plot) GetData() (PlotData, error)

GetData gets plot data that can be rendered by Dygraph

type PlotData

type PlotData struct {
	Title  string
	Labels []string
	Data   []byte
}

Jump to

Keyboard shortcuts

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