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

Function CostTrackerOptions

cel/options.go:923–928  ·  view source on GitHub ↗

CostTrackerOptions configures a set of options for cost-tracking. Note, CostTrackerOptions is a no-op unless CostTracking is also enabled.

(costOpts ...cost.TrackerOption)

Source from the content-addressed store, hash-verified

921//
922// Note, CostTrackerOptions is a no-op unless CostTracking is also enabled.
923func CostTrackerOptions(costOpts ...cost.TrackerOption) ProgramOption {
924 return func(p *prog) (*prog, error) {
925 p.costOptions = append(p.costOptions, costOpts...)
926 return p, nil
927 }
928}
929
930// CostTracking enables cost tracking and registers a ActualCostEstimator that can optionally provide a runtime cost estimate for any function calls.
931func CostTracking(costEstimator cost.ActualCostEstimator) ProgramOption {

Callers 11

ProgramOptionsMethod · 0.92
computeCostFunction · 0.92
ProgramOptionsMethod · 0.85
TestEvalFunction · 0.85
TestCostLimitFunction · 0.85

Calls

no outgoing calls

Tested by 9

computeCostFunction · 0.74
TestEvalFunction · 0.68
TestCostLimitFunction · 0.68