OverloadCostTracker binds an overload ID to a runtime FunctionTracker implementation. OverloadCostTracker instances augment or override ActualCostEstimator decisions, allowing for versioned and/or optional cost tracking changes.
(overloadID string, fnTracker FunctionTracker)
| 213 | // OverloadCostTracker instances augment or override ActualCostEstimator decisions, allowing for versioned and/or |
| 214 | // optional cost tracking changes. |
| 215 | func OverloadCostTracker(overloadID string, fnTracker FunctionTracker) CostTrackerOption { |
| 216 | return func(tracker *CostTracker) error { |
| 217 | tracker.overloadTrackers[overloadID] = fnTracker |
| 218 | return nil |
| 219 | } |
| 220 | } |
| 221 | |
| 222 | // FunctionTracker computes the actual cost of evaluating the functions with the given arguments and result. |
| 223 | type FunctionTracker func(args []ref.Val, result ref.Val) *uint64 |
no outgoing calls