bandwidth

package
v1.113.1 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2024 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// Error is an error class for bandwidth service error.
	Error = errs.Class("bandwidth")
)

Functions

This section is empty.

Types

type Egress

type Egress struct {
	Repair int64 `json:"repair"`
	Audit  int64 `json:"audit"`
	Usage  int64 `json:"usage"`
}

Egress stores info about storage node egress usage.

type Ingress

type Ingress struct {
	Repair int64 `json:"repair"`
	Usage  int64 `json:"usage"`
}

Ingress stores info about storage node ingress usage.

type Monthly

type Monthly struct {
	BandwidthDaily   []UsageRollup `json:"bandwidthDaily"`
	BandwidthSummary int64         `json:"bandwidthSummary"`
	EgressSummary    int64         `json:"egressSummary"`
	IngressSummary   int64         `json:"ingressSummary"`
}

Monthly contains all bandwidth, ingress, egress monthly data.

type Service

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

Service exposes bandwidth related logic.

architecture: Service

func NewService

func NewService(log *zap.Logger, dialer rpc.Dialer, nodes *nodes.Service) *Service

NewService creates new instance of Service.

func (*Service) Monthly

func (service *Service) Monthly(ctx context.Context) (_ Monthly, err error)

Monthly returns monthly bandwidth summary.

func (*Service) MonthlyNode

func (service *Service) MonthlyNode(ctx context.Context, nodeID storj.NodeID) (_ Monthly, err error)

MonthlyNode returns monthly bandwidth summary for single node.

func (*Service) MonthlySatellite

func (service *Service) MonthlySatellite(ctx context.Context, satelliteID storj.NodeID) (_ Monthly, err error)

MonthlySatellite returns monthly bandwidth summary for specific satellite.

func (*Service) MonthlySatelliteNode

func (service *Service) MonthlySatelliteNode(ctx context.Context, satelliteID, nodeID storj.NodeID) (_ Monthly, err error)

MonthlySatelliteNode returns monthly bandwidth summary for single node and specific satellites.

type UsageRollup

type UsageRollup struct {
	Egress        Egress    `json:"egress"`
	Ingress       Ingress   `json:"ingress"`
	Delete        int64     `json:"delete"`
	IntervalStart time.Time `json:"intervalStart"`
}

UsageRollup contains rolluped bandwidth usage.

type UsageRollupDailyCache

type UsageRollupDailyCache map[time.Time]UsageRollup

UsageRollupDailyCache caches storage usage stamps by interval date.

func (*UsageRollupDailyCache) Add

func (cache *UsageRollupDailyCache) Add(rollup UsageRollup)

Add adds usage rollup to cache aggregating bandwidth data by date.

func (*UsageRollupDailyCache) Sorted

func (cache *UsageRollupDailyCache) Sorted() []UsageRollup

Sorted returns usage rollup slice sorted by interval start.

Jump to

Keyboard shortcuts

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