tally

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2019 License: AGPL-3.0 Imports: 12 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" default:"1h" devDefault:"30s"`
}

Config contains configurable values for the tally service

type Service added in v0.9.0

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

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

func New

func New(logger *zap.Logger, accountingDB accounting.DB, pointerdb *pointerdb.Service, overlay *overlay.Cache, limit int, interval time.Duration) *Service

New creates a new tally Service

func (*Service) CalculateAtRestData added in v0.9.0

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 pointerdb and calculates the amount of at-rest data stored in each bucket and on each respective node

func (*Service) Run added in v0.9.0

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

Run the tally service loop

func (*Service) SaveAtRestRaw added in v0.9.0

func (t *Service) SaveAtRestRaw(ctx context.Context, latestTally time.Time, created time.Time, nodeData map[storj.NodeID]float64) error

SaveAtRestRaw records raw tallies of at-rest-data and updates the LastTimestamp

func (*Service) Tally added in v0.9.0

func (t *Service) Tally(ctx context.Context) 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