nodetally

package
v1.50.4 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2022 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Error is a standard error class for this package.

Functions

This section is empty.

Types

type Observer

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

Observer observes metainfo and adds up tallies for nodes and buckets.

func NewObserver

func NewObserver(log *zap.Logger, now time.Time) *Observer

NewObserver returns an segment loop observer that adds up totals for nodes.

func (*Observer) InlineSegment

func (observer *Observer) InlineSegment(ctx context.Context, segment *segmentloop.Segment) (err error)

InlineSegment is called for each inline segment.

func (*Observer) LoopStarted

func (observer *Observer) LoopStarted(context.Context, segmentloop.LoopInfo) (err error)

LoopStarted is called at each start of a loop.

func (*Observer) RemoteSegment

func (observer *Observer) RemoteSegment(ctx context.Context, segment *segmentloop.Segment) (err error)

RemoteSegment is called for each remote segment.

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

New creates a new node tally Service.

func (*Service) Close

func (service *Service) Close() error

Close stops the service and releases any resources.

func (*Service) Run

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

Run the node tally service loop.

func (*Service) SetNow

func (service *Service) SetNow(now func() time.Time)

SetNow allows tests to have the Service act as if the current time is whatever they want. This avoids races and sleeping, making tests more reliable and efficient.

func (*Service) Tally

func (service *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