CostTracking enables cost tracking and registers a ActualCostEstimator that can optionally provide a runtime cost estimate for any function calls.
(costEstimator interpreter.ActualCostEstimator)
| 755 | |
| 756 | // CostTracking enables cost tracking and registers a ActualCostEstimator that can optionally provide a runtime cost estimate for any function calls. |
| 757 | func CostTracking(costEstimator interpreter.ActualCostEstimator) ProgramOption { |
| 758 | return func(p *prog) (*prog, error) { |
| 759 | p.callCostEstimator = costEstimator |
| 760 | p.evalOpts |= OptTrackCost |
| 761 | return p, nil |
| 762 | } |
| 763 | } |
| 764 | |
| 765 | // CostLimit enables cost tracking and sets configures program evaluation to exit early with a |
| 766 | // "runtime cost limit exceeded" error if the runtime cost exceeds the costLimit. |
no outgoing calls