vegeta: github.com/tsenart/vegeta/lib/lttb Index | Files

package lttb

import "github.com/tsenart/vegeta/lib/lttb"

Index

Package Files

lttb.go

type Iter Uses

type Iter func(count int) ([]Point, error)

An Iter is an iterator function that returns count number of Points or an error.

type Point Uses

type Point struct{ X, Y float64 }

A Point in a line chart.

func Downsample Uses

func Downsample(count, threshold int, it Iter) ([]Point, error)

Downsample `count` number of data points retrieved from the given iterator function to contain only `threshold` number of points while maintaining close visual similarity to the original data. The algorithm is called Largest-Triangle-Three-Buckets and is described in: https://skemman.is/bitstream/1946/15343/3/SS_MSthesis.pdf

This implementation grew out of https://github.com/dgryski/go-lttb to limit memory usage by leveraging iterators.

Package lttb imports 1 packages (graph) and is imported by 2 packages. Updated 2019-03-02. Refresh now. Tools for package owners.