CostTracking enables cost tracking and registers a ActualCostEstimator that can optionally provide a runtime cost estimate for any function calls.
(costEstimator interpreter.ActualCostEstimator)
| 811 | |
| 812 | // CostTracking enables cost tracking and registers a ActualCostEstimator that can optionally provide a runtime cost estimate for any function calls. |
| 813 | func CostTracking(costEstimator interpreter.ActualCostEstimator) ProgramOption { |
| 814 | return func(p *prog) (*prog, error) { |
| 815 | p.callCostEstimator = costEstimator |
| 816 | p.evalOpts |= OptTrackCost |
| 817 | return p, nil |
| 818 | } |
| 819 | } |
| 820 | |
| 821 | // CostLimit enables cost tracking and sets configures program evaluation to exit early with a |
| 822 | // "runtime cost limit exceeded" error if the runtime cost exceeds the costLimit. |
no outgoing calls