bytecounter

package
v0.0.0-...-bd88772 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2021 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Counter

type Counter struct {
	Received *atomicx.Int64
	Sent     *atomicx.Int64
}

Counter counts bytes sent and received.

func New

func New() *Counter

New creates a new Counter.

func (*Counter) BytesReceived

func (c *Counter) BytesReceived() int64

BytesReceived returns the bytes received so far.

func (*Counter) BytesSent

func (c *Counter) BytesSent() int64

BytesSent returns the bytes sent so far.

func (*Counter) CountBytesReceived

func (c *Counter) CountBytesReceived(count int)

CountBytesReceived adds count to the bytes received counter.

func (*Counter) CountBytesSent

func (c *Counter) CountBytesSent(count int)

CountBytesSent adds count to the bytes sent counter.

func (*Counter) CountKibiBytesReceived

func (c *Counter) CountKibiBytesReceived(count float64)

CountKibiBytesReceived adds 1024*count to the bytes received counter.

func (*Counter) CountKibiBytesSent

func (c *Counter) CountKibiBytesSent(count float64)

CountKibiBytesSent adds 1024*count to the bytes sent counter.

func (*Counter) KibiBytesReceived

func (c *Counter) KibiBytesReceived() float64

KibiBytesReceived returns the KiB received so far.

func (*Counter) KibiBytesSent

func (c *Counter) KibiBytesSent() float64

KibiBytesSent returns the KiB sent so far.

Jump to

Keyboard shortcuts

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