(meta map[string]any, keys ...string)
| 5381 | } |
| 5382 | |
| 5383 | func durationFromMetadata(meta map[string]any, keys ...string) time.Duration { |
| 5384 | if len(meta) == 0 { |
| 5385 | return 0 |
| 5386 | } |
| 5387 | for _, key := range keys { |
| 5388 | if val, ok := meta[key]; ok { |
| 5389 | if dur := parseDurationValue(val); dur > 0 { |
| 5390 | return dur |
| 5391 | } |
| 5392 | } |
| 5393 | } |
| 5394 | return 0 |
| 5395 | } |
| 5396 | |
| 5397 | func durationFromAttributes(attrs map[string]string, keys ...string) time.Duration { |
| 5398 | if len(attrs) == 0 { |
no test coverage detected