stats

package
v0.0.0-...-b425644 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewProgress

func NewProgress(total int) *progress

func Percentile

func Percentile(values []float64, perc float64) float64

func PercentileFloat

func PercentileFloat(values []float64, perc int) (o float64)

Types

type Map

type Map map[string]*Value

func (Map) Inc

func (m Map) Inc(key string) int

func (Map) IncBy

func (m Map) IncBy(key string, value int) int

func (Map) ReversedValues

func (m Map) ReversedValues() Values

func (Map) SortedValues

func (m Map) SortedValues() Values

func (Map) String

func (m Map) String() string

func (Map) Sum

func (m Map) Sum() (sum int)

func (Map) Values

func (m Map) Values() Values

type ProgressWriter

type ProgressWriter struct {
	Total   int64
	Written int64
	// contains filtered or unexported fields
}

func (*ProgressWriter) Close

func (p *ProgressWriter) Close() error

func (*ProgressWriter) Write

func (p *ProgressWriter) Write(b []byte) (int, error)

type Stats

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

func New

func New(values ...float64) *Stats

func (*Stats) Add

func (stats *Stats) Add(values ...float64)

func (*Stats) Avg

func (stats *Stats) Avg() float64

func (*Stats) Len

func (stats *Stats) Len() int

func (*Stats) Max

func (stats *Stats) Max() float64

func (*Stats) Median

func (stats *Stats) Median() float64

func (*Stats) Min

func (stats *Stats) Min() float64

func (*Stats) Perc

func (stats *Stats) Perc(perc float64) float64

Perc calculates the percentile, use 50 for median

func (*Stats) Reset

func (stats *Stats) Reset()

func (*Stats) Sort

func (stats *Stats) Sort()

func (*Stats) StdDeviation

func (s *Stats) StdDeviation() float64

func (*Stats) String

func (stats *Stats) String() string

func (*Stats) Sum

func (stats *Stats) Sum() float64

func (*Stats) Values

func (stats *Stats) Values() []float64

func (*Stats) Variance

func (stats *Stats) Variance() float64

type Value

type Value struct {
	Key   string
	Value int
}

type Values

type Values []*Value

func (Values) Len

func (list Values) Len() int

func (Values) Less

func (list Values) Less(a, b int) bool

func (Values) String

func (v Values) String() string

func (Values) Swap

func (list Values) Swap(a, b int)

func (Values) TopN

func (list Values) TopN(n int) Values

Jump to

Keyboard shortcuts

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