MCPcopy Create free account
hub / github.com/cel-expr/cel-go / OverloadCostTracker

Function OverloadCostTracker

interpreter/runtimecost.go:215–220  ·  view source on GitHub ↗

OverloadCostTracker binds an overload ID to a runtime FunctionTracker implementation. OverloadCostTracker instances augment or override ActualCostEstimator decisions, allowing for versioned and/or optional cost tracking changes.

(overloadID string, fnTracker FunctionTracker)

Source from the content-addressed store, hash-verified

213// OverloadCostTracker instances augment or override ActualCostEstimator decisions, allowing for versioned and/or
214// optional cost tracking changes.
215func OverloadCostTracker(overloadID string, fnTracker FunctionTracker) CostTrackerOption {
216 return func(tracker *CostTracker) error {
217 tracker.overloadTrackers[overloadID] = fnTracker
218 return nil
219 }
220}
221
222// FunctionTracker computes the actual cost of evaluating the functions with the given arguments and result.
223type FunctionTracker func(args []ref.Val, result ref.Val) *uint64

Callers 8

ProgramOptionsMethod · 0.92
ProgramOptionsMethod · 0.92
ProgramOptionsMethod · 0.92
ProgramOptionsMethod · 0.92
TestEvalFunction · 0.92
TestCostLimitFunction · 0.92
TestRuntimeCostFunction · 0.85

Calls

no outgoing calls

Tested by 4

TestEvalFunction · 0.74
TestCostLimitFunction · 0.74
TestRuntimeCostFunction · 0.68