bandwidth

package
v0.1.0-cvefix.3 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Monitor

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

Monitor implements the monitoring for bandwidth measurements.

func NewMonitor

func NewMonitor(doneCh <-chan struct{}) *Monitor

NewMonitor returns a monitor with defaults.

func (*Monitor) DeleteBucket

func (m *Monitor) DeleteBucket(bucket string)

DeleteBucket deletes monitoring the 'bucket'

func (*Monitor) GetReport

func (m *Monitor) GetReport(selectBucket SelectionFunction) *bandwidth.Report

GetReport gets the report for all bucket bandwidth details.

func (*Monitor) SubscribeToBuckets

func (m *Monitor) SubscribeToBuckets(subCh chan interface{}, doneCh <-chan struct{}, buckets []string)

SubscribeToBuckets subscribes to buckets. Empty array for monitoring all buckets.

type MonitoredReader

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

MonitoredReader monitors the bandwidth

func NewMonitoredReader

func NewMonitoredReader(ctx context.Context, monitor *Monitor, bucket string, object string, reader io.ReadCloser, headerSize int, bandwidthBytesPerSecond int64, clusterBandwidth int64) *MonitoredReader

NewMonitoredReader returns a io.ReadCloser that reports bandwidth details. The supplied reader will be closed.

func (*MonitoredReader) Close

func (m *MonitoredReader) Close() error

Close stops tracking the io

func (*MonitoredReader) Read

func (m *MonitoredReader) Read(p []byte) (n int, err error)

Read wraps the read reader

type SelectionFunction

type SelectionFunction func(bucket string) bool

SelectionFunction for buckets

func SelectBuckets

func SelectBuckets(buckets ...string) SelectionFunction

SelectBuckets will select all the buckets passed in.

Jump to

Keyboard shortcuts

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