Help us shape the future of Go! Take the 2026 Go Developer Survey

chanstats

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2023 License: AGPL-3.0, AGPL-3.0 Imports: 2 Imported by: 0

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
}

ChanStats represents recorded channel statistics

func New

func New() *ChanStats

New returns a pointer to new ChanStats struct with statistics initialised

type Details

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

Details represents detailed statistics

func NewDetails

func NewDetails(m *Messages) *Details

NewDetails holds detailed information on channel statistics in one direction

type Messages

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

Messages represents statistics for messages

type Report

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

Report represents overally statistics for a topic

func NewReport

func NewReport(s *ChanStats) *Report

NewReport represents a new report on channel statistics

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"`
}

WelfordStats represents statistical values

func NewWelford

func NewWelford(w *welford.Stats) *WelfordStats

NewWelford initialises a new statistics structure

Jump to

Keyboard shortcuts

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