nodetally

package
v1.105.4 Latest Latest
Warning

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

Go to latest
Published: May 29, 2024 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Error is a standard error class for this package.
	Error = errs.Class("node tally")
)

Functions

This section is empty.

Types

type Observer

type Observer struct {
	Node map[metabase.NodeAlias]float64
	// contains filtered or unexported fields
}

Observer implements node tally ranged loop observer.

func NewObserver

func NewObserver(log *zap.Logger, accounting accounting.StoragenodeAccounting, metabaseDB *metabase.DB) *Observer

NewObserver creates new tally range loop observer.

func (*Observer) Finish added in v1.78.1

func (observer *Observer) Finish(ctx context.Context) (err error)

Finish calculates byte*hours from per node storage usage and save tallies to DB.

func (*Observer) Fork added in v1.78.1

func (observer *Observer) Fork(ctx context.Context) (_ rangedloop.Partial, err error)

Fork forks new node tally ranged loop partial.

func (*Observer) Join added in v1.78.1

func (observer *Observer) Join(ctx context.Context, partial rangedloop.Partial) (err error)

Join joins node tally ranged loop partial to main observer updating main per node usage map.

func (*Observer) SetNow added in v1.78.1

func (observer *Observer) SetNow(nowFn func() time.Time)

SetNow overrides the timestamp used to store the result.

func (*Observer) Start added in v1.78.1

func (observer *Observer) Start(ctx context.Context, time time.Time) (err error)

Start implements ranged loop observer start method.

Jump to

Keyboard shortcuts

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