workload

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package workload provides workload prediction

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheOptimizer

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

CacheOptimizer provides intelligent caching

func NewCacheOptimizer

func NewCacheOptimizer() *CacheOptimizer

NewCacheOptimizer creates a cache optimizer

func (*CacheOptimizer) GetHitRate

func (co *CacheOptimizer) GetHitRate() float64

GetHitRate returns the cache hit rate

func (*CacheOptimizer) OptimizeCacheSize

func (co *CacheOptimizer) OptimizeCacheSize(currentSize int, hitRate float64) int

OptimizeCacheSize recommends optimal cache size

func (*CacheOptimizer) RecordHit

func (co *CacheOptimizer) RecordHit()

RecordHit records a cache hit

func (*CacheOptimizer) RecordMiss

func (co *CacheOptimizer) RecordMiss()

RecordMiss records a cache miss

func (*CacheOptimizer) ShouldCache

func (co *CacheOptimizer) ShouldCache(contentSize int, accessFrequency float64) bool

ShouldCache determines if content should be cached

type Predictor

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

Predictor predicts workload patterns

func NewPredictor

func NewPredictor() *Predictor

NewPredictor creates a new workload predictor

func (*Predictor) AddData

func (p *Predictor) AddData(data WorkloadData)

AddData adds workload data

func (*Predictor) Predict

func (p *Predictor) Predict(hoursAhead int) WorkloadPrediction

Predict predicts future workload

type WorkloadData

type WorkloadData struct {
	Timestamp time.Time
	Requests  int
	Tokens    int
	Cost      float64
	Duration  time.Duration
}

WorkloadData represents historical workload data

type WorkloadPrediction

type WorkloadPrediction struct {
	PredictedRequests int
	PredictedTokens   int
	PredictedCost     float64
	Confidence        float64
	TimeRange         time.Duration
}

WorkloadPrediction represents a workload prediction

Jump to

Keyboard shortcuts

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