histogram

package
v0.1.15 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2020 License: Apache-2.0 Imports: 4 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HDR2ASCII

func HDR2ASCII(hist *hdr.Histogram, numChars, floor, ceil int) string

Types

type Histogram

type Histogram struct {
	Vals       []ScalarVal
	ValMin     ScalarVal
	ValMax     ScalarVal
	NumBuckets int
	// contains filtered or unexported fields
}

Histogram stores all the values, and defines the range and bucket count. Values outside the range end up in underflow/overflow buckets.

func (*Histogram) Add

func (h *Histogram) Add(v ScalarVal)

Add appends a value into the dataset

func (Histogram) Quantile

func (h Histogram) Quantile(quantile int) (ScalarVal, bool)

Quantile returns a value from the dataset, below which 'ile'% of the values fall

func (Histogram) Stats

func (h Histogram) Stats() (*Stats, bool)

Stats computes some basic statistics on the dataset, and returns them

func (Histogram) String

func (h Histogram) String() string

String returns a string representation of the ascii histogram, and the stats

func (*Histogram) UseBlockRunes

func (h *Histogram) UseBlockRunes()

UseBlockRunes will use UTF8 block characters instead of ascii letters in the histogram string

type ScalarVal

type ScalarVal int

ScalarVal is a type wrapper for the kind of numbers we're accummulating into the histogram. (It would be nice to use some kind of 'Number' type, that handles ints & floats.)

type Set

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

func NewSet

func NewSet(maxval int) Set

func (Set) RecordValue

func (s Set) RecordValue(name string, val int64)

func (Set) String

func (s Set) String() string

type Stats

type Stats struct {
	N            int
	Mean         float64
	Stddev       float64
	Percentile50 ScalarVal
	Percentile90 ScalarVal
}

Stats reports some statistical properties for the dataset

Jump to

Keyboard shortcuts

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