rollup

package
v1.70.1 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2023 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Error = errs.Class("rollup")
)

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 rollup should run" releaseDefault:"24h" devDefault:"120s" testDefault:"$TESTINTERVAL"`
	DeleteTallies          bool          `help:"option for deleting tallies after they are rolled up" default:"true"`
	DeleteTalliesBatchSize int           `help:"how many tallies to delete in a batch" default:"10000"`
}

Config contains configurable values for rollup.

type Service

type Service struct {
	Loop *sync2.Cycle

	OrderExpiration time.Duration
	// contains filtered or unexported fields
}

Service is the rollup service for totalling data on storage nodes on daily intervals.

architecture: Chore

func New

func New(logger *zap.Logger, sdb accounting.StoragenodeAccounting, config Config, orderExpiration time.Duration) *Service

New creates a new rollup service.

func (*Service) Close added in v0.21.0

func (r *Service) Close() error

Close stops the service and releases any resources.

func (*Service) Rollup

func (r *Service) Rollup(ctx context.Context) (err error)

Rollup aggregates storage and bandwidth amounts for the time interval.

func (*Service) RollupBW

func (r *Service) RollupBW(ctx context.Context, lastRollup time.Time, rollupStats accounting.RollupStats) (err error)

RollupBW aggregates the bandwidth rollups, modifies rollupStats map.

func (*Service) RollupStorage

func (r *Service) RollupStorage(ctx context.Context, lastRollup time.Time, rollupStats accounting.RollupStats) (latestTally time.Time, err error)

RollupStorage rolls up storage tally, modifies rollupStats map.

func (*Service) Run

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

Run the Rollup loop.

Jump to

Keyboard shortcuts

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