From 1cc4c3b2433524aac81ef783f9316534a9748537 Mon Sep 17 00:00:00 2001 From: tanjunchen <2799194073@qq.com> Date: Sun, 13 Oct 2019 11:58:52 +0800 Subject: [PATCH] Refactor test/integration/master/ with metric --- test/integration/master/BUILD | 2 +- test/integration/master/transformation_testcase.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/integration/master/BUILD b/test/integration/master/BUILD index bf4e4f38e0f..f002126b8ce 100644 --- a/test/integration/master/BUILD +++ b/test/integration/master/BUILD @@ -135,10 +135,10 @@ go_library( "//staging/src/k8s.io/apiserver/pkg/storage/storagebackend:go_default_library", "//staging/src/k8s.io/apiserver/pkg/storage/value:go_default_library", "//staging/src/k8s.io/client-go/kubernetes:go_default_library", + "//staging/src/k8s.io/component-base/metrics/legacyregistry:go_default_library", "//test/integration:go_default_library", "//test/integration/framework:go_default_library", "//vendor/github.com/coreos/etcd/clientv3:go_default_library", - "//vendor/github.com/prometheus/client_golang/prometheus:go_default_library", "//vendor/k8s.io/klog:go_default_library", "//vendor/sigs.k8s.io/yaml:go_default_library", ] + select({ diff --git a/test/integration/master/transformation_testcase.go b/test/integration/master/transformation_testcase.go index 3b957dbdcb7..d43e5651046 100644 --- a/test/integration/master/transformation_testcase.go +++ b/test/integration/master/transformation_testcase.go @@ -30,7 +30,7 @@ import ( "k8s.io/klog" "github.com/coreos/etcd/clientv3" - "github.com/prometheus/client_golang/prometheus" + "k8s.io/component-base/metrics/legacyregistry" "sigs.k8s.io/yaml" corev1 "k8s.io/api/core/v1" @@ -241,7 +241,7 @@ func (e *transformTest) readRawRecordFromETCD(path string) (*clientv3.GetRespons func (e *transformTest) printMetrics() error { e.logger.Logf("Transformation Metrics:") - metrics, err := prometheus.DefaultGatherer.Gather() + metrics, err := legacyregistry.DefaultGatherer.Gather() if err != nil { return fmt.Errorf("failed to gather metrics: %s", err) }