benchbee

package
v0.0.0-...-4eed7f7 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2020 License: ISC Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BenchBeeMetadata

type BenchBeeMetadata struct {
	ISP string
	IP  string

	Download   string
	Upload     string
	PingWS     string
	DownloadWS string
	UploadWS   string

	ServerIPInfo *tool.IPInfo
}

func FetchBasicInfo

func FetchBasicInfo(client *http.Client) (*BenchBeeMetadata, error)

type Speedtest

type Speedtest struct {
	Info    *BenchBeeMetadata
	Options *SpeedtestOptions
	Result  *SpeedtestResult
	// contains filtered or unexported fields
}

func NewSpeedtest

func NewSpeedtest(info *BenchBeeMetadata, options SpeedtestOptions) *Speedtest

func (*Speedtest) TestPing

func (st *Speedtest) TestPing() error

func (*Speedtest) TestSpeed

func (st *Speedtest) TestSpeed(testWorkerType SpeedtestWorkerType, cb SpeedtestIntermediateResultCallback) error

type SpeedtestIntermediateResult

type SpeedtestIntermediateResult struct {
	Duration time.Duration
	Bytes    uint64
}

type SpeedtestIntermediateResultCallback

type SpeedtestIntermediateResultCallback = func(result SpeedtestIntermediateResult)

type SpeedtestOptions

type SpeedtestOptions struct {
	PingCount               int
	DownloadTestDuration    time.Duration
	UploadTestDuration      time.Duration
	DownloadTestConcurrency int
	UploadTestConcurrency   int
	Header                  http.Header
	CallbackPollInterval    time.Duration
	UserAgent               string
	Dialer                  *net.Dialer
}

type SpeedtestResult

type SpeedtestResult struct {
	PingMillis            float64
	JitterMillis          float64
	TotalBytesDownloaded  uint64
	TotalDownloadDuration time.Duration
	TotalBytesUploaded    uint64
	TotalUploadDuration   time.Duration
}

type SpeedtestWorkerType

type SpeedtestWorkerType int
const (
	SpeedtestDownloadWorker SpeedtestWorkerType = iota
	SpeedtestUploadWorker
)

Jump to

Keyboard shortcuts

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