CostLimit enables cost tracking and sets configures program evaluation to exit early with a "runtime cost limit exceeded" error if the runtime cost exceeds the costLimit. The CostLimit is a metric that corresponds to the number and estimated expense of operations performed while evaluating an expres
(costLimit uint64)
| 767 | // The CostLimit is a metric that corresponds to the number and estimated expense of operations |
| 768 | // performed while evaluating an expression. It is indicative of CPU usage, not memory usage. |
| 769 | func CostLimit(costLimit uint64) ProgramOption { |
| 770 | return func(p *prog) (*prog, error) { |
| 771 | p.costLimit = &costLimit |
| 772 | p.evalOpts |= OptTrackCost |
| 773 | return p, nil |
| 774 | } |
| 775 | } |
| 776 | |
| 777 | func fieldToCELType(field protoreflect.FieldDescriptor) (*Type, error) { |
| 778 | if field.Kind() == protoreflect.MessageKind || field.Kind() == protoreflect.GroupKind { |
no outgoing calls