(queryResponseTime time.Duration, headers http.Header, stats *querier_stats.QueryStats)
| 654 | } |
| 655 | |
| 656 | func writeServiceTimingHeader(queryResponseTime time.Duration, headers http.Header, stats *querier_stats.QueryStats) { |
| 657 | if stats != nil { |
| 658 | parts := make([]string, 0) |
| 659 | parts = append(parts, statsValue("querier_wall_time", stats.LoadWallTime())) |
| 660 | parts = append(parts, statsValue("response_time", queryResponseTime)) |
| 661 | headers.Set(ServiceTimingHeaderName, strings.Join(parts, ", ")) |
| 662 | } |
| 663 | } |
| 664 | |
| 665 | func statsValue(name string, d time.Duration) string { |
| 666 | durationInMs := strconv.FormatFloat(float64(d)/float64(time.Millisecond), 'f', -1, 64) |
no test coverage detected