Documentation ¶
Index ¶
- Variables
- type Config
- type Service
- func (r *Service) Rollup(ctx context.Context) error
- func (r *Service) RollupBW(ctx context.Context, lastRollup time.Time, rollupStats accounting.RollupStats) error
- func (r *Service) RollupStorage(ctx context.Context, lastRollup time.Time, rollupStats accounting.RollupStats) (latestTally time.Time, err error)
- func (r *Service) Run(ctx context.Context) (err error)
Constants ¶
This section is empty.
Variables ¶
View Source
var (
Error = errs.Class("rollup 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 rollup should run" releaseDefault:"24h" devDefault:"120s"` MaxAlphaUsage memory.Size `help:"the bandwidth and storage usage limit for the alpha release" default:"25GB"` DeleteTallies bool `help:"option for deleting tallies after they are rolled up" default:"false"` }
Config contains configurable values for rollup
type Service ¶ added in v0.9.0
type Service struct {
// contains filtered or unexported fields
}
Service is the rollup service for totalling data on storage nodes on daily intervals
func New ¶
func New(logger *zap.Logger, sdb accounting.StoragenodeAccounting, interval time.Duration, deleteTallies bool) *Service
New creates a new rollup service
func (*Service) Rollup ¶ added in v0.9.0
Rollup aggregates storage and bandwidth amounts for the time interval
func (*Service) RollupBW ¶ added in v0.9.0
func (r *Service) RollupBW(ctx context.Context, lastRollup time.Time, rollupStats accounting.RollupStats) error
RollupBW aggregates the bandwidth rollups, modifies rollupStats map
func (*Service) RollupStorage ¶ added in v0.9.0
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
Click to show internal directories.
Click to hide internal directories.