optimize

package
v0.1.23 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2026 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MB = 1024 * 1024
	GB = 1024 * MB

	// Size thresholds from PLAN.md
	SmallDatapointLimit = 100      // datapoints
	SmallSizeLimit      = 10 * MB  // 10MB
	MediumSizeLimit     = 100 * MB // 100MB
	LargeSizeLimit      = 1 * GB   // 1GB
	MaxAggregateSize    = 5 * GB   // 5GB

	// Minimum dataranges to aggregate for small datapoints
	MinDatarangesForSmallAggregation = 10
)

Variables

This section is empty.

Functions

func Command

func Command() *cli.Command

Types

type Datarange added in v0.1.16

type Datarange struct {
	ID              int64
	MinDatapointKey int64
	MaxDatapointKey int64
	SizeBytes       int64
	DatapointCount  int64
}

Datarange represents a datarange with its metadata

type Operation added in v0.1.16

type Operation struct {
	Type           OptimizationType
	DatarangeIDs   []int64
	FirstDatapoint uint64
	LastDatapoint  uint64
	TotalSize      int64
	Reason         string
}

Operation represents an optimization operation to perform

type OptimizationType added in v0.1.16

type OptimizationType string

OptimizationType describes the type of optimization

const (
	OptimizationSmallDatapoints  OptimizationType = "Small Datapoints Aggregation"
	OptimizationSmallToMedium    OptimizationType = "Small to Medium Size Aggregation"
	OptimizationMediumToLarge    OptimizationType = "Medium to Large Size Aggregation"
	OptimizationLargeToVeryLarge OptimizationType = "Large to Very Large Size Aggregation"
)

type Optimizer added in v0.1.16

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

Optimizer handles optimization logic

func NewOptimizer added in v0.1.16

func NewOptimizer(dataranges []client.DatarangeInfo) *Optimizer

NewOptimizer creates a new optimizer from datarange info

func (*Optimizer) FindBestOptimization added in v0.1.16

func (o *Optimizer) FindBestOptimization() *Operation

FindBestOptimization finds the best optimization according to priority rules

Jump to

Keyboard shortcuts

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