tdigest

package
v0.0.0-...-d30abd5 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

README

package tdigest

import "github.com/zeebo/rothko/dist/tdigest"

package tdigest provides a wrapper around github.com/zeebo/tdigest.

Usage

type Params
type Params struct {
	Compression float64
}

Params implements dist.Params for a t-digest distribution.

func (Params) Kind
func (p Params) Kind() string

Kind returns the TDigest distribution kind.

func (Params) New
func (p Params) New() (dist.Dist, error)

New returns a new TDigest as a dist.Dist.

func (Params) Unmarshal
func (p Params) Unmarshal(data []byte) (dist.Dist, error)

Unmarshal loads a dist.Dist out of some bytes.

type Wrapper
type Wrapper struct {
}

Wrapper implements dist.Dist for a t-digest.

func Wrap
func Wrap(td *tdigest.TDigest) *Wrapper

Wrap wraps the given t-digest.

func (*Wrapper) CDF
func (w *Wrapper) CDF(x float64) float64

CDF returns the estimate CDF at the value x.

func (Wrapper) Kind
func (Wrapper) Kind() string

Kind returns the string "tdigest".

func (Wrapper) Len
func (w Wrapper) Len() int64

Len returns how many items were added to the t-digest.

func (Wrapper) Marshal
func (w Wrapper) Marshal(buf []byte) []byte

Marshal appends a byte form of the t-digest to the provided buffer.

func (Wrapper) Observe
func (w Wrapper) Observe(val float64)

Observe adds the value to the t-digest.

func (Wrapper) Query
func (w Wrapper) Query(x float64) float64

Query returns the approximate x'th quantile.

func (Wrapper) Underlying
func (w Wrapper) Underlying() *tdigest.TDigest

Underlying returns the underlying t-digest.

Documentation

Overview

package tdigest provides a wrapper around github.com/zeebo/tdigest.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Params

type Params struct {
	Compression float64
}

Params implements dist.Params for a t-digest distribution.

func (Params) Kind

func (p Params) Kind() string

Kind returns the TDigest distribution kind.

func (Params) New

func (p Params) New() (dist.Dist, error)

New returns a new TDigest as a dist.Dist.

func (Params) Unmarshal

func (p Params) Unmarshal(data []byte) (dist.Dist, error)

Unmarshal loads a dist.Dist out of some bytes.

type Wrapper

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

Wrapper implements dist.Dist for a t-digest.

func Wrap

func Wrap(td *tdigest.TDigest) *Wrapper

Wrap wraps the given t-digest.

func (*Wrapper) CDF

func (w *Wrapper) CDF(x float64) float64

CDF returns the estimate CDF at the value x.

func (Wrapper) Kind

func (Wrapper) Kind() string

Kind returns the string "tdigest".

func (Wrapper) Len

func (w Wrapper) Len() int64

Len returns how many items were added to the t-digest.

func (Wrapper) Marshal

func (w Wrapper) Marshal(buf []byte) []byte

Marshal appends a byte form of the t-digest to the provided buffer.

func (Wrapper) Observe

func (w Wrapper) Observe(val float64)

Observe adds the value to the t-digest.

func (Wrapper) Query

func (w Wrapper) Query(x float64) float64

Query returns the approximate x'th quantile.

func (Wrapper) Underlying

func (w Wrapper) Underlying() *tdigest.TDigest

Underlying returns the underlying t-digest.

Jump to

Keyboard shortcuts

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