history

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Ring

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

func New

func New(cap int) *Ring

func (*Ring) Cap

func (r *Ring) Cap() int

func (*Ring) Last

func (r *Ring) Last() float64

Last returns the most recently pushed value, or 0 if empty.

func (*Ring) Len

func (r *Ring) Len() int

func (*Ring) Push

func (r *Ring) Push(v float64)

func (*Ring) Reset

func (r *Ring) Reset()

func (*Ring) Slice

func (r *Ring) Slice() []float64

type Tracker

type Tracker struct {
	PeakDown  float64
	PeakUp    float64
	TodayDown float64 // bytes
	TodayUp   float64 // bytes
	Year      int
	Month     time.Month
	Day       int
}

Tracker keeps session peak and today totals.

func NewTracker

func NewTracker() *Tracker

func (*Tracker) Load added in v0.2.0

func (t *Tracker) Load() error

func (*Tracker) Record

func (t *Tracker) Record(downBps, upBps, intervalSecs float64)

Record updates peaks and today totals. intervalSecs is the sample interval.

func (*Tracker) ResetPeaks

func (t *Tracker) ResetPeaks()

func (*Tracker) Save added in v0.2.0

func (t *Tracker) Save() error

Jump to

Keyboard shortcuts

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