linlog

package module
v0.0.0-...-87314c5 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2021 License: MIT Imports: 2 Imported by: 9

Documentation

Overview

Package linlog implements linear-log bucketing

http://pvk.ca/Blog/2015/06/27/linear-log-bucketing-fast-versatile-simple/

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BinDownOf

func BinDownOf(size uint64, linear, subbin uint64) (rounded uint64, bucket uint64)

BinDownOf rounds size down, and returns the rounded size and bucket number.

func BinOf

func BinOf(size uint64, linear, subbin uint64) (rounded uint64, bucket uint64)

BinOf rounds size as appropriate, and returns the rounded size and bucket number.

func Bins

func Bins(max uint64, linear, subbin uint64) []uint64

Types

type Bin

type Bin struct {
	Size  uint64
	Count uint64
}

type Histogram

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

func NewHistogram

func NewHistogram(max, linear, subbin uint64) *Histogram

func (*Histogram) AtomicBins

func (h *Histogram) AtomicBins() []Bin

func (*Histogram) AtomicInsert

func (h *Histogram) AtomicInsert(n uint64)

func (*Histogram) Bins

func (h *Histogram) Bins() []Bin

func (*Histogram) Insert

func (h *Histogram) Insert(n uint64)

Jump to

Keyboard shortcuts

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