Documentation
¶
Index ¶
- Constants
- func Command() *cli.Command
- type AggregationOperation
- type AggregationOptimizer
- func (ao *AggregationOptimizer) FindAllBeneficialAggregations() []*AggregationOperation
- func (ao *AggregationOptimizer) FindBestAggregation() *AggregationOperation
- func (ao *AggregationOptimizer) SetBalanceParameters(minFilesForSmall int, maxSizeRatio int, allowMixedSizes bool)
- func (ao *AggregationOptimizer) SetThresholds(minScore float64, targetSize int64, maxAggregateSize int64)
- type TarFile
Constants ¶
View Source
const ( MaxAggregateSize = 5 * 1024 * 1024 * 1024 // 5GB in bytes TargetSize = 1 * 1024 * 1024 * 1024 // 1GB target size MinThreshold = 1.0 // Minimum AVS score to perform aggregation OperationCostBase = 0.1 // Base cost per operation )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AggregationOperation ¶
type AggregationOperation struct {
Files []TarFile
Score float64
FirstDatapoint uint64
LastDatapoint uint64
}
AggregationOperation represents a potential aggregation
type AggregationOptimizer ¶
type AggregationOptimizer struct {
// contains filtered or unexported fields
}
AggregationOptimizer handles the aggregation logic
func NewAggregationOptimizer ¶
func NewAggregationOptimizer(files []TarFile) *AggregationOptimizer
NewAggregationOptimizer creates a new optimizer
func (*AggregationOptimizer) FindAllBeneficialAggregations ¶
func (ao *AggregationOptimizer) FindAllBeneficialAggregations() []*AggregationOperation
FindAllBeneficialAggregations finds all aggregations above the threshold
func (*AggregationOptimizer) FindBestAggregation ¶
func (ao *AggregationOptimizer) FindBestAggregation() *AggregationOperation
FindBestAggregation finds the optimal aggregation operation
func (*AggregationOptimizer) SetBalanceParameters ¶
func (ao *AggregationOptimizer) SetBalanceParameters(minFilesForSmall int, maxSizeRatio int, allowMixedSizes bool)
SetBalanceParameters allows customizing balance validation parameters
func (*AggregationOptimizer) SetThresholds ¶
func (ao *AggregationOptimizer) SetThresholds(minScore float64, targetSize int64, maxAggregateSize int64)
SetThresholds allows customizing optimization thresholds
type TarFile ¶
type TarFile struct {
ID string
Size int64
MinID uint64 // Minimum datapoint ID in the file
MaxID uint64 // Maximum datapoint ID in the file
S3Key string
Created time.Time
}
TarFile represents a tar file with metadata (adapted from client.DatarangeInfo)
func ConvertFromDatarangeInfo ¶
func ConvertFromDatarangeInfo(dataranges []client.DatarangeInfo) []TarFile
ConvertFromDatarangeInfo converts client.DatarangeInfo to TarFile
Click to show internal directories.
Click to hide internal directories.