Documentation ¶
Index ¶
- Variables
- type Observer
- type RangedLoopObserver
- func (observer *RangedLoopObserver) Finish(ctx context.Context) (err error)
- func (observer *RangedLoopObserver) Fork(ctx context.Context) (_ rangedloop.Partial, err error)
- func (observer *RangedLoopObserver) Join(ctx context.Context, partial rangedloop.Partial) (err error)
- func (observer *RangedLoopObserver) SetNow(nowFn func() time.Time)
- func (observer *RangedLoopObserver) Start(ctx context.Context, time time.Time) (err error)
- type RangedLoopPartial
- type Service
Constants ¶
This section is empty.
Variables ¶
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[metabase.NodeAlias]float64 // contains filtered or unexported fields }
Observer observes metainfo and adds up tallies for nodes and buckets.
func NewObserver ¶
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 ¶
LoopStarted is called at each start of a loop.
func (*Observer) RemoteSegment ¶
RemoteSegment is called for each remote segment.
type RangedLoopObserver ¶ added in v1.71.1
type RangedLoopObserver struct { Node map[metabase.NodeAlias]float64 // contains filtered or unexported fields }
RangedLoopObserver implements node tally ranged loop observer.
func NewRangedLoopObserver ¶ added in v1.71.1
func NewRangedLoopObserver(log *zap.Logger, accounting accounting.StoragenodeAccounting, metabaseDB *metabase.DB) *RangedLoopObserver
NewRangedLoopObserver creates new RangedLoopObserver.
func (*RangedLoopObserver) Finish ¶ added in v1.71.1
func (observer *RangedLoopObserver) Finish(ctx context.Context) (err error)
Finish calculates byte*hours from per node storage usage and save tallies to DB.
func (*RangedLoopObserver) Fork ¶ added in v1.71.1
func (observer *RangedLoopObserver) Fork(ctx context.Context) (_ rangedloop.Partial, err error)
Fork forks new node tally ranged loop partial.
func (*RangedLoopObserver) Join ¶ added in v1.71.1
func (observer *RangedLoopObserver) 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 (*RangedLoopObserver) SetNow ¶ added in v1.71.1
func (observer *RangedLoopObserver) SetNow(nowFn func() time.Time)
SetNow overrides the timestamp used to store the result.
type RangedLoopPartial ¶ added in v1.71.1
type RangedLoopPartial struct { Node map[metabase.NodeAlias]float64 // contains filtered or unexported fields }
RangedLoopPartial implements node tally ranged loop partial.
func NewRangedLoopPartial ¶ added in v1.71.1
func NewRangedLoopPartial(log *zap.Logger, nowFn func() time.Time) *RangedLoopPartial
NewRangedLoopPartial creates new node tally ranged loop partial.
func (*RangedLoopPartial) Process ¶ added in v1.71.1
func (partial *RangedLoopPartial) Process(ctx context.Context, segments []segmentloop.Segment) error
Process iterates over segment range updating partial node usage map.
type Service ¶
Service is the tally service for data stored on each storage node.
architecture: Chore
func New ¶
func New(log *zap.Logger, sdb accounting.StoragenodeAccounting, mdb *metabase.DB, loop *segmentloop.Service, interval time.Duration) *Service
New creates a new node tally Service.