MCPcopy Create free account
hub / github.com/cortexproject/cortex / NewEmptyPrometheusResponse

Function NewEmptyPrometheusResponse

pkg/querier/tripperware/query.go:285–306  ·  view source on GitHub ↗

NewEmptyPrometheusResponse returns an empty successful Prometheus query range response.

(instant bool)

Source from the content-addressed store, hash-verified

283
284// NewEmptyPrometheusResponse returns an empty successful Prometheus query range response.
285func NewEmptyPrometheusResponse(instant bool) *PrometheusResponse {
286 if instant {
287 return &PrometheusResponse{
288 Status: StatusSuccess,
289 Data: PrometheusData{
290 ResultType: model.ValVector.String(),
291 Result: PrometheusQueryResult{
292 Result: &PrometheusQueryResult_Vector{},
293 },
294 },
295 }
296 }
297 return &PrometheusResponse{
298 Status: StatusSuccess,
299 Data: PrometheusData{
300 ResultType: model.ValMatrix.String(),
301 Result: PrometheusQueryResult{
302 Result: &PrometheusQueryResult_Matrix{},
303 },
304 },
305 }
306}
307
308func encodeSampleStream(ptr unsafe.Pointer, stream *jsoniter.Stream) {
309 ss := (*SampleStream)(ptr)

Calls 1

StringMethod · 0.65