nbntest

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

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

Go to latest
Published: Dec 8, 2017 License: MIT Imports: 5 Imported by: 0

README

NBN Test

Test your nbn connection

This program can be used to record your modem statistics and the results of speedtest.net tests over a period of time

image

Supported Outputs

  • InfluxDB wiki
  • Console

Supported Modems

  • TPLink TD-9970
  • Technicolor TGiiNet-1
  • Technicolor TG789vac
  • Generic Telnet via LUA

Releases

Binary releases for a handful of platforms are available on the releases page and will basically be any version I think is stable enough not to be awful.

Building your own

I've started a wiki page covering the quick start to installing the Go build environment and building the binary

Extras

In the Extra dir there's some bits and pieces to get you started including the grafana dashboard in the screenshot above

TODO

  • Remove the external dependancies for people who want to run it stand alone
    • Internal storage
    • Internal graphing
  • Add more modems
  • Add a http lua module

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListModems

func ListModems() []string

func RegisterModems

func RegisterModems(name string, f func() Modem)

func RegisterOutputter

func RegisterOutputter(name string, f func() Outputter)

Types

type Configuration

type Configuration struct {
	Modem     *ModemConfiguration       `toml:"modem"`
	SpeedTest *SpeedtestConfiguration   `toml:"speedtest"`
	Output    map[string]toml.Primitive `toml:"output"`
	// contains filtered or unexported fields
}

func LoadConfiguration

func LoadConfiguration(file string) (*Configuration, error)

func (*Configuration) UnifyModemConfiguration

func (c *Configuration) UnifyModemConfiguration(name string, v interface{}) (err error)

func (*Configuration) UnifyOutputConfiguration

func (c *Configuration) UnifyOutputConfiguration(name string, v interface{}) (err error)

type Modem

type Modem interface {
	Init(*Configuration) error
	Gather() (*ModemStatistics, error)
}

func GetModem

func GetModem(name string) (modemInterface Modem)

type ModemConfiguration

type ModemConfiguration struct {
	Interval      gct.Duration              `toml:"interval"`
	Interface     string                    `toml:"type"`
	Configuration map[string]toml.Primitive `toml:"config"`
}

type ModemStatistics

type ModemStatistics struct {
	Upstream       StreamStatistics
	Downstream     StreamStatistics
	ModemUptime    time.Duration
	ShowtimeUptime time.Duration
}

type NBNTest

type NBNTest struct {
	Config  *Configuration
	Outputs Outputs
	// contains filtered or unexported fields
}

func (*NBNTest) CollectFromModem

func (t *NBNTest) CollectFromModem(now time.Time) error

func (*NBNTest) CollectFromSpeedtest

func (t *NBNTest) CollectFromSpeedtest(now time.Time)

func (*NBNTest) Run

func (t *NBNTest) Run() error

type Outputs

type Outputs []Outputter

func (*Outputs) Init

func (o *Outputs) Init(c *Configuration)

func (Outputs) RecordError

func (o Outputs) RecordError(t time.Time, err error)

func (Outputs) RecordModem

func (o Outputs) RecordModem(t time.Time, stat ModemStatistics)

func (Outputs) RecordSpeedtest

func (o Outputs) RecordSpeedtest(t time.Time, id int, latency time.Duration, up, down float64)

type Outputter

type Outputter interface {
	Init(c *Configuration)
	RecordError(t time.Time, err error)
	RecordModem(t time.Time, stat ModemStatistics)
	RecordSpeedtest(t time.Time, id int, latency time.Duration, up, down float64)
}

type SpeedtestConfiguration

type SpeedtestConfiguration struct {
	Interval gct.Duration `toml:"interval"`
	Site     int          `toml:"site"`
	Fastest  int          `toml:"fastest"`
}

type StreamStatistics

type StreamStatistics struct {
	CurrRate    float64
	MaxRate     float64
	NoiseMargin []float64
	Attenuation []float64
	Power       []float64
}

Jump to

Keyboard shortcuts

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