statistics

package
v0.0.0-...-9bc905a Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2019 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Statistics

type Statistics struct {
	TotalDownloads          int       `json:"totalDownloads"`
	TotalDownloaded         int       `json:"totalDownloaded"`
	TotalFailed             int       `json:"totalFailed"`
	TotalDownloadedBytes    uint64    `json:"totalDownloadedBytes"`
	AverageSpeedFilesPerSec float64   `json:"averageSpeedFilesPerSec"`
	SpeedBytesPerSec        float64   `json:"speedBytesPerSec"`
	StartTime               time.Time `json:"startTime"`
	FilesRemaining          int       `json:"filesRemaining"`
	AverageSpeedBytesPerSec float64   `json:"averageSpeedBytesPerSec"`
	// contains filtered or unexported fields
}

Statistics - statistics about the downloads

func New

func New() Statistics

New returns a new Statistics instance with start time the current time

func (*Statistics) Print

func (stats *Statistics) Print()

Print prints a row with the statistics

func (*Statistics) PrintEnd

func (stats *Statistics) PrintEnd()

PrintEnd is called on program exit and prints some useful final stats

func (*Statistics) PrintHeader

func (stats *Statistics) PrintHeader()

PrintHeader prints the header of the statistics

func (*Statistics) Update

func (stats *Statistics) Update(log logging.LogEntry)

Update updates the statistics from a new log entry

Jump to

Keyboard shortcuts

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