adaptive

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultInlineThreshold = 256
	InlineHardMin          = DefaultInlineThreshold
	InlineHardMax          = 2048
	DefaultStep            = 64
	UpdateInterval         = 100 // K commits
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

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

Controller manages the adaptive inline threshold.

func New

func New() *Controller

func (*Controller) GetThreshold

func (c *Controller) GetThreshold() int

GetThreshold returns the current threshold to use for a new batch.

func (*Controller) RecordCommit

func (c *Controller) RecordCommit(m Metrics)

RecordCommit updates the controller with metrics from a completed commit.

type Metrics

type Metrics struct {
	LeafFill        float64 // 0..1
	Splits          int
	IndexWriteBytes int
	SlabWriteBytes  int
	SlabDeadBytes   int

	// SlabWriteBytesByFile tracks bytes appended to each slab file during this
	// commit (keyed by FileID).
	SlabWriteBytesByFile map[uint32]int64
	// SlabDeadBytesByFile tracks bytes that became dead in each slab file during
	// this commit due to overwrite/delete of pointer values.
	SlabDeadBytesByFile map[uint32]int64
}

Metrics represents the telemetry gathered during a single commit.

Jump to

Keyboard shortcuts

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