MCPcopy Create free account
hub / github.com/cel-expr/cel-go / CostTrackerFactory

Function CostTrackerFactory

interpreter/runtimecost.go:42–47  ·  view source on GitHub ↗

CostTrackerFactory configures the factory method to generate a new cost-tracker per-evaluation.

(factory func() (*CostTracker, error))

Source from the content-addressed store, hash-verified

40
41// CostTrackerFactory configures the factory method to generate a new cost-tracker per-evaluation.
42func CostTrackerFactory(factory func() (*CostTracker, error)) costTrackPlanOption {
43 return func(fac *costTrackerFactory) *costTrackerFactory {
44 fac.factory = factory
45 return fac
46 }
47}
48
49// CostObserver provides an observer that tracks runtime cost.
50func CostObserver(opts ...costTrackPlanOption) PlannerOption {

Callers 2

newProgramFunction · 0.92
computeCostFunction · 0.85

Calls

no outgoing calls

Tested by 1

computeCostFunction · 0.68