stats

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Stats

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

Stats provide a way to track statistics infos

func New

func New() *Stats

New creates a new Stats

func (*Stats) AddBytes

func (s *Stats) AddBytes(c uint64)

AddBytes increase the nbBytes counter

func (*Stats) Bandwidth

func (s *Stats) Bandwidth() float64

Bandwidth returns the IO speed in MB/s

func (*Stats) Bytes

func (s *Stats) Bytes() uint64

Bytes returns the stored number of bytes

func (*Stats) Duration

func (s *Stats) Duration() time.Duration

Duration returns the 'stop - start' duration, if stopped Returns 0 if not started Returns time.Since(s.timeStart) if not stopped

func (*Stats) Pause

func (s *Stats) Pause()

Pause stores an interruption timestamp

func (*Stats) Start

func (s *Stats) Start()

Start stores the "start" timestamp

func (*Stats) Stop

func (s *Stats) Stop()

Stop stores the "stop" timestamp

func (*Stats) String

func (s *Stats) String() string

Jump to

Keyboard shortcuts

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