tally

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2019 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Error = errs.Class("tally error")
)

Error is a standard error class for this package.

Functions

This section is empty.

Types

type Config

type Config struct {
	Interval time.Duration `help:"how frequently the tally service should run" releaseDefault:"1h" devDefault:"30s"`
}

Config contains configurable values for the tally service

type Service

type Service struct {
	Loop sync2.Cycle
	// contains filtered or unexported fields
}

Service is the tally service for data stored on each storage node

architecture: Chore

func New

func New(logger *zap.Logger, sdb accounting.StoragenodeAccounting, pdb accounting.ProjectAccounting, liveAccounting live.Service, metainfo *metainfo.Service, overlay *overlay.Service, interval time.Duration) *Service

New creates a new tally Service

func (*Service) CalculateAtRestData

func (t *Service) CalculateAtRestData(ctx context.Context) (latestTally time.Time, nodeData map[storj.NodeID]float64, bucketTallies map[string]*accounting.BucketTally, err error)

CalculateAtRestData iterates through the pieces on metainfo and calculates the amount of at-rest data stored in each bucket and on each respective node

func (*Service) Close added in v0.21.0

func (t *Service) Close() error

Close stops the service and releases any resources.

func (*Service) Run

func (t *Service) Run(ctx context.Context) (err error)

Run the tally service loop

func (*Service) Tally

func (t *Service) Tally(ctx context.Context) (err error)

Tally calculates data-at-rest usage once

Jump to

Keyboard shortcuts

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