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