@@ -363,17 +363,8 @@ func TestPrometheusQueryClient_ResultToLabelsMap(t *testing.T) {
363363 {
364364 name : "single metric with multiple labels" ,
365365 input : & PrometheusQueryResponse {
366- Data : struct {
367- ResultType string `json:"resultType"`
368- Result []struct {
369- Metric map [string ]string `json:"metric"`
370- Value []interface {} `json:"value"`
371- } `json:"result"`
372- }{
373- Result : []struct {
374- Metric map [string ]string `json:"metric"`
375- Value []interface {} `json:"value"`
376- }{
366+ Data : & PromQueryResponseData {
367+ Result : []PromQueryResponseResult {
377368 {
378369 Metric : map [string ]string {
379370 "__name__" : "http_requests_total" ,
@@ -394,17 +385,8 @@ func TestPrometheusQueryClient_ResultToLabelsMap(t *testing.T) {
394385 {
395386 name : "multiple metrics with shared labels" ,
396387 input : & PrometheusQueryResponse {
397- Data : struct {
398- ResultType string `json:"resultType"`
399- Result []struct {
400- Metric map [string ]string `json:"metric"`
401- Value []interface {} `json:"value"`
402- } `json:"result"`
403- }{
404- Result : []struct {
405- Metric map [string ]string `json:"metric"`
406- Value []interface {} `json:"value"`
407- }{
388+ Data : & PromQueryResponseData {
389+ Result : []PromQueryResponseResult {
408390 {
409391 Metric : map [string ]string {
410392 "__name__" : "http_requests_total" ,
@@ -434,35 +416,17 @@ func TestPrometheusQueryClient_ResultToLabelsMap(t *testing.T) {
434416 {
435417 name : "empty result" ,
436418 input : & PrometheusQueryResponse {
437- Data : struct {
438- ResultType string `json:"resultType"`
439- Result []struct {
440- Metric map [string ]string `json:"metric"`
441- Value []interface {} `json:"value"`
442- } `json:"result"`
443- }{
444- Result : []struct {
445- Metric map [string ]string `json:"metric"`
446- Value []interface {} `json:"value"`
447- }{},
419+ Data : & PromQueryResponseData {
420+ Result : nil ,
448421 },
449422 },
450423 expected : map [string ][]interface {}{},
451424 },
452425 {
453426 name : "metric with no labels" ,
454427 input : & PrometheusQueryResponse {
455- Data : struct {
456- ResultType string `json:"resultType"`
457- Result []struct {
458- Metric map [string ]string `json:"metric"`
459- Value []interface {} `json:"value"`
460- } `json:"result"`
461- }{
462- Result : []struct {
463- Metric map [string ]string `json:"metric"`
464- Value []interface {} `json:"value"`
465- }{
428+ Data : & PromQueryResponseData {
429+ Result : []PromQueryResponseResult {
466430 {
467431 Metric : map [string ]string {},
468432 Value : []interface {}{float64 (1435781451.781 ), "1" },
0 commit comments