bandwidth

package
v0.15.4 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2019 License: AGPL-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 DB

type DB interface {
	Add(ctx context.Context, satelliteID storj.NodeID, action pb.PieceAction, amount int64, created time.Time) error
	// MonthSummary returns summary of the current months bandwidth usages
	MonthSummary(ctx context.Context) (int64, error)
	Rollup(ctx context.Context) (err error)
	Summary(ctx context.Context, from, to time.Time) (*Usage, error)
	SummaryBySatellite(ctx context.Context, from, to time.Time) (map[storj.NodeID]*Usage, error)
	// Run starts the background process for rollups of bandwidth usage
	Run(ctx context.Context) (err error)
	// Close stop the background process for rollups of bandwidth usage
	Close() (err error)
}

DB contains information about bandwidth usage.

type Usage

type Usage struct {
	Invalid int64
	Unknown int64

	Put       int64
	Get       int64
	GetAudit  int64
	GetRepair int64
	PutRepair int64
	Delete    int64
}

Usage contains bandwidth usage information based on the type

func TotalMonthlySummary added in v0.10.0

func TotalMonthlySummary(ctx context.Context, db DB) (*Usage, error)

TotalMonthlySummary returns total bandwidth usage for current month

func (*Usage) Add

func (usage *Usage) Add(b *Usage)

Add adds another usage to this one.

func (*Usage) Include

func (usage *Usage) Include(action pb.PieceAction, amount int64)

Include adds specified action to the appropriate field.

func (*Usage) Total

func (usage *Usage) Total() int64

Total sums all type of bandwidths

Jump to

Keyboard shortcuts

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