netchart

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2025 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

Package netchart implements basic chart to generate small minimalistic chart of network usage.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chart

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

func New

func New(w, h, lineSize float64) *Chart

func (*Chart) Canvas

func (c *Chart) Canvas() fc.Canvas

func (*Chart) Container

func (c *Chart) Container() *fyne.Container

func (*Chart) UpdateNamed

func (c *Chart) UpdateNamed(stats map[string][]float64, clrs map[string]color.RGBA, orders []string) error

type Recorder

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

func NewRecorder

func NewRecorder(s Source) *Recorder

NewRecorder creates a default Recorder TODO: Decrease detalization for old data as the time goes on to allow for longer ranges charts.

func (*Recorder) BytesRead

func (r *Recorder) BytesRead() int

func (*Recorder) BytesWritten

func (r *Recorder) BytesWritten() int

func (*Recorder) Read

func (r *Recorder) Read() []float64

func (*Recorder) ReadSinceLast

func (r *Recorder) ReadSinceLast() int

ReadSinceLast returns bytes read from last call (upload).

func (*Recorder) RecordInterval

func (r *Recorder) RecordInterval() time.Duration

func (*Recorder) Start

func (r *Recorder) Start()

func (*Recorder) Stop

func (r *Recorder) Stop()

func (*Recorder) Written

func (r *Recorder) Written() []float64

func (*Recorder) WrittenSinceLast

func (r *Recorder) WrittenSinceLast() int

WrittenSinceLast returns bytes written from last call (download).

type Source

type Source interface {
	BytesRead() int
	BytesWritten() int
}

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳