File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
internal/cortex/querier/queryrange Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change 1+ // Copyright (c) The Cortex Authors.
2+ // Licensed under the Apache License 2.0.
3+
4+ package queryrange
5+
6+ import (
7+ "testing"
8+
9+ "github.com/stretchr/testify/require"
10+ )
11+
12+ func TestQueryBytesFetchedPrometheusResponseHeaders (t * testing.T ) {
13+ resp1 := PrometheusResponse {Headers : []* PrometheusResponseHeader {& PrometheusResponseHeader {Name : "M3-Fetched-Bytes-Estimate" , Values : []string {"100" }}}}
14+ resp2 := PrometheusResponse {Headers : []* PrometheusResponseHeader {& PrometheusResponseHeader {Name : "M3-Fetched-Bytes-Estimate" , Values : []string {"1000" }}}}
15+ resp3 := PrometheusResponse {}
16+ hdrs := QueryBytesFetchedPrometheusResponseHeaders (& resp1 , & resp2 , & resp3 )
17+ expected := []* PrometheusResponseHeader {{Name : QueryBytesFetchedHeaderName ,
18+ Values : []string {"1100" }}}
19+ require .Equal (t , hdrs , expected )
20+ }
You can’t perform that action at this time.
0 commit comments