slotmgr

package
v1.27.2 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2025 License: Apache-2.0, MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// KeySlotOffset tags metrics with the slot offset.
	KeySlotOffset, _ = tag.NewKey("slot_offset")
)
View Source
var SlotMgrMeasures = struct {
	SlotsAvailable *stats.Int64Measure
	SlotsAcquired  *stats.Int64Measure
	SlotsReleased  *stats.Int64Measure
	SlotErrors     *stats.Int64Measure
}{
	SlotsAvailable: stats.Int64(pre+"slots_available", "Number of available slots.", stats.UnitDimensionless),
	SlotsAcquired:  stats.Int64(pre+"slots_acquired", "Total number of slots acquired.", stats.UnitDimensionless),
	SlotsReleased:  stats.Int64(pre+"slots_released", "Total number of slots released.", stats.UnitDimensionless),
	SlotErrors:     stats.Int64(pre+"slot_errors", "Total number of slot errors (e.g., failed to put).", stats.UnitDimensionless),
}

SlotMgrMeasures groups the high-level slotmgr metrics.

View Source
var SlotMgrSlotMeasures = struct {
	SlotInUse       *stats.Int64Measure
	SlotSectorCount *stats.Int64Measure
}{
	SlotInUse:       stats.Int64(pre+"slot_in_use", "Slot actively in use (batch sealing). 1=in use, 0=not in use", stats.UnitDimensionless),
	SlotSectorCount: stats.Int64(pre+"slot_sector_count", "Number of sectors in the slot", stats.UnitDimensionless),
}

SlotMgrSlotMeasures groups per-slot metrics.

View Source
var WatchInterval = 5 * time.Minute

Functions

This section is empty.

Types

type SlotMgr

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

func NewSlotMgr

func NewSlotMgr(db *harmonydb.DB, machineHostAndPort string, slotOffs []uint64) (*SlotMgr, error)

NewSlotMgr creates the SlotMgr and initializes local references from the DB.

func (*SlotMgr) AbortSlot added in v1.24.4

func (s *SlotMgr) AbortSlot(slotOff uint64) error

AbortSlot marks a slot which was used for work as immediately free

func (*SlotMgr) Available

func (s *SlotMgr) Available() int

Available returns how many slots are currently free (i.e. 0 sectors).

func (*SlotMgr) Get

func (s *SlotMgr) Get(ids []abi.SectorID) uint64

Get allocates a slot for work. Called from a batch sealing task.

func (*SlotMgr) MarkWorkDone added in v1.24.4

func (s *SlotMgr) MarkWorkDone(slotOff uint64) error

MarkWorkDone marks a slot as no longer being actively used for batch sealing This is when sectors start waiting for finalization (After C1 outputs were produced)

func (*SlotMgr) SectorDone added in v1.24.4

func (s *SlotMgr) SectorDone(ctx context.Context, slotOff uint64, id abi.SectorID) error

SectorDone removes a sector from a slot. Called when a sector is fully finalized.

Jump to

Keyboard shortcuts

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