stat64

package
Version: v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package stat64 provides a byte buffer-based statistical summary that maintains the mean, count, variance and sum of float64 samples.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Len

func Len() int

Len returns the length of the buffer required to serialize a summary

func Reset

func Reset(buf []byte) error

Reset returns all measures tracked by the summary represented by the supplied byte buffer to their zero values.

Types

type Summary

type Summary []byte

Summary is a summary that maintains basic statistical measures for a series of observations. It requires 32 bytes.

func New

func New() Summary

New creates a new stat64 Summary, allocating a new backing buffer.

func WithBytes

func WithBytes(buf []byte) Summary

WithBytes creates a new stat64 Summary backed by the buffer buf which must be at least 32 bytes in length.

func (Summary) Count

func (s Summary) Count() uint64

Count returns the number the series of observations.

func (Summary) Len

func (s Summary) Len() int

Size returns the length of the buffer required to serialize the summary

func (Summary) Mean

func (s Summary) Mean() float64

Mean returns the mean of the observation values.

func (Summary) Reset

func (s Summary) Reset() error

Reset returns all measures tracked by the summary to their zero values.

func (Summary) Sum

func (s Summary) Sum() float64

Sum returns the sum of the observation values.

func (Summary) Update

func (s Summary) Update(v float64)

Update adds an observation to the summary.

func (Summary) UpdateMulti

func (s Summary) UpdateMulti(vs []float64)

UpdateMulti adds a list of observation to the summary.

func (Summary) Variance

func (s Summary) Variance() float64

Variance returns the sample variance of the series of observations.

Source Files

Jump to

Keyboard shortcuts

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