CostTrackerOptions configures a set of options for cost-tracking. Note, CostTrackerOptions is a no-op unless CostTracking is also enabled.
(costOpts ...interpreter.CostTrackerOption)
| 747 | // |
| 748 | // Note, CostTrackerOptions is a no-op unless CostTracking is also enabled. |
| 749 | func CostTrackerOptions(costOpts ...interpreter.CostTrackerOption) ProgramOption { |
| 750 | return func(p *prog) (*prog, error) { |
| 751 | p.costOptions = append(p.costOptions, costOpts...) |
| 752 | return p, nil |
| 753 | } |
| 754 | } |
| 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 { |
no outgoing calls