| 3960 | var timeToYearCost uint64 = 7 |
| 3961 | |
| 3962 | func (e testRuntimeCostEstimator) CallCost(function, overloadID string, args []ref.Val, result ref.Val) *uint64 { |
| 3963 | argsSize := make([]uint64, len(args)) |
| 3964 | for i, arg := range args { |
| 3965 | reflectV := reflect.ValueOf(arg.Value()) |
| 3966 | switch reflectV.Kind() { |
| 3967 | // Note that the CEL bytes type is implemented with Go byte slices, therefore also supported by the following |
| 3968 | // code. |
| 3969 | case reflect.String, reflect.Array, reflect.Slice, reflect.Map: |
| 3970 | argsSize[i] = uint64(reflectV.Len()) |
| 3971 | default: |
| 3972 | argsSize[i] = 1 |
| 3973 | } |
| 3974 | } |
| 3975 | return nil |
| 3976 | } |
| 3977 | |
| 3978 | func trackTimestampToYear(args []ref.Val, result ref.Val) *uint64 { |
| 3979 | return &timeToYearCost |