pruner

package
v0.11.0-rc15-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConstructModule

func ConstructModule(tp node.Type, cfg *Config) fx.Option

func Flags

func Flags() *flag.FlagSet

func ParseFlags

func ParseFlags(
	cmd *cobra.Command,
	cfg *Config,
)

func WithStoragePrunerMetrics

func WithStoragePrunerMetrics(sp *StoragePruner) error

WithStoragePrunerMetrics is a utility function to turn on storage pruner metrics and that is expected to be "invoked" by the fx lifecycle.

Types

type Config

type Config struct {
	PruningEnabled bool
	EpochDuration  time.Duration
	RecencyWindow  time.Duration
}

func DefaultConfig

func DefaultConfig() Config

type StoragePruner

type StoragePruner struct {
	// contains filtered or unexported fields
}

func NewStoragePruner

func NewStoragePruner(ds datastore.Batching, store *eds.Store, cfg Config) *StoragePruner

func (*StoragePruner) Register

func (sp *StoragePruner) Register(ctx context.Context, h *header.ExtendedHeader) error

func (*StoragePruner) Start

func (sp *StoragePruner) Start(ctx context.Context) error

func (*StoragePruner) Stop

func (sp *StoragePruner) Stop(_ context.Context) error

func (*StoragePruner) WithMetrics

func (sp *StoragePruner) WithMetrics() error

Jump to

Keyboard shortcuts

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