| 756 | } |
| 757 | |
| 758 | func (s *PrometheusResponseStats) MarshalJSON() ([]byte, error) { |
| 759 | stats := struct { |
| 760 | Samples *PrometheusResponseSamplesStats `json:"samples"` |
| 761 | }{ |
| 762 | Samples: s.Samples, |
| 763 | } |
| 764 | if s.Samples.TotalQueryableSamplesPerStep == nil { |
| 765 | s.Samples.TotalQueryableSamplesPerStep = []*PrometheusResponseQueryableSamplesStatsPerStep{} |
| 766 | } |
| 767 | return json.Marshal(stats) |
| 768 | } |
| 769 | |
| 770 | func SetRequestHeaders(h http.Header, defaultCodecType CodecType, compression Compression) { |
| 771 | switch compression { |