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

Function CostTracking

cel/options.go:931–937  ·  view source on GitHub ↗

CostTracking enables cost tracking and registers a ActualCostEstimator that can optionally provide a runtime cost estimate for any function calls.

(costEstimator cost.ActualCostEstimator)

Source from the content-addressed store, hash-verified

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 {
932 return func(p *prog) (*prog, error) {
933 p.callCostEstimator = costEstimator
934 p.evalOpts |= OptTrackCost
935 return p, nil
936 }
937}
938
939// MemoryTracking enables peak memory tracking during evaluation with an optional set of
940// types.MemoryTrackerOption values to configure the tracker's size calculator, sample

Callers 15

testCostFunction · 0.92
TestStringFormatFunction · 0.92
TestStringFormatV2Function · 0.92
testEvalWithCostFunction · 0.92
evalWithCELFunction · 0.92
TestStringCostTrackingFunction · 0.92
TestDecodeNonBase64ErrorFunction · 0.92

Calls

no outgoing calls

Tested by 15

testCostFunction · 0.74
TestStringFormatFunction · 0.74
TestStringFormatV2Function · 0.74
testEvalWithCostFunction · 0.74
evalWithCELFunction · 0.74
TestStringCostTrackingFunction · 0.74
TestDecodeNonBase64ErrorFunction · 0.74