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

Function estimateMathListCost

ext/math.go:961–969  ·  view source on GitHub ↗
(estimator cost.Estimator, target *cost.AstNode, args []cost.AstNode)

Source from the content-addressed store, hash-verified

959}
960
961func estimateMathListCost(estimator cost.Estimator, target *cost.AstNode, args []cost.AstNode) *cost.CallEstimate {
962 if len(args) != 1 {
963 return nil
964 }
965 sz := cost.EstimateSize(estimator, args[0])
966 c := sz.MultiplyByCostFactor(1.0).Add(cost.CallCostEstimate)
967 resultSize := cost.FixedSizeEstimate(1)
968 return cost.NewCallEstimate(c, &resultSize)
969}
970
971func trackMathListCost(args []ref.Val, _ ref.Val) *uint64 {
972 sz := cost.ActualSize(args[0])

Callers

nothing calls this directly

Calls 5

EstimateSizeFunction · 0.92
FixedSizeEstimateFunction · 0.92
NewCallEstimateFunction · 0.92
AddMethod · 0.65
MultiplyByCostFactorMethod · 0.45

Tested by

no test coverage detected