unmarshalTimestamp extracts the string value from a timestamp object.
(val json.RawMessage)
| 309 | |
| 310 | // unmarshalTimestamp extracts the string value from a timestamp object. |
| 311 | func unmarshalTimestamp(val json.RawMessage) (any, bool) { |
| 312 | var ts map[string]string |
| 313 | if json.Unmarshal(val, &ts) == nil { |
| 314 | if v, ok := ts["value"]; ok { |
| 315 | return v, true |
| 316 | } |
| 317 | } |
| 318 | return nil, false |
| 319 | } |
| 320 | |
| 321 | // parseLatencyMs parses a duration string like "0.012s" into milliseconds. |
| 322 | func parseLatencyMs(latency string) int64 { |
no test coverage detected