chanstats

package module
v0.0.0-...-b0c6a75 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2019 License: AGPL-3.0 Imports: 2 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChanStats

type ChanStats struct {
	ConnectedAt time.Time
	Rx          Messages
	Tx          Messages
}

Structs for recording stats

func New

func New() *ChanStats

type Details

type Details struct {
	Last  string       `json:"last"` //how many seconds ago...
	Bytes WelfordStats `json:"bytes"`
	Dt    WelfordStats `json:"dt"`
}

func NewDetails

func NewDetails(m *Messages) *Details

type Messages

type Messages struct {
	Last  time.Time
	Bytes *welford.Stats
	Dt    *welford.Stats
}

type Report

type Report struct {
	Connected string  `json:"connected"`
	Tx        Details `json:"tx"`
	Rx        Details `json:"rx"`
}

Structs for (un)marshalling stats into JSON

func NewReport

func NewReport(s *ChanStats) *Report

type WelfordStats

type WelfordStats struct {
	Count    uint64  `json:"count"`
	Min      float64 `json:"min"`
	Max      float64 `json:"max"`
	Mean     float64 `json:"mean"`
	Stddev   float64 `json:"stddev"`
	Variance float64 `json:"variance"`
}

func NewWelford

func NewWelford(w *welford.Stats) *WelfordStats

Jump to

Keyboard shortcuts

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