| 4357 | var timeToYearCost uint64 = 7 |
| 4358 | |
| 4359 | func (e testRuntimeCostEstimator) CallCost(function, overloadID string, args []ref.Val, result ref.Val) *uint64 { |
| 4360 | argsSize := make([]uint64, len(args)) |
| 4361 | for i, arg := range args { |
| 4362 | reflectV := reflect.ValueOf(arg.Value()) |
| 4363 | switch reflectV.Kind() { |
| 4364 | // Note that the CEL bytes type is implemented with Go byte slices, therefore also supported by the following |
| 4365 | // code. |
| 4366 | case reflect.String, reflect.Array, reflect.Slice, reflect.Map: |
| 4367 | argsSize[i] = uint64(reflectV.Len()) |
| 4368 | default: |
| 4369 | argsSize[i] = 1 |
| 4370 | } |
| 4371 | } |
| 4372 | return nil |
| 4373 | } |
| 4374 | |
| 4375 | func trackTimestampToYear(args []ref.Val, result ref.Val) *uint64 { |
| 4376 | return &timeToYearCost |