diff --git a/pkg/controller/garbagecollector/BUILD b/pkg/controller/garbagecollector/BUILD index 58901c622b3..b6e88d24c4a 100644 --- a/pkg/controller/garbagecollector/BUILD +++ b/pkg/controller/garbagecollector/BUILD @@ -15,7 +15,6 @@ go_library( "garbagecollector.go", "graph.go", "graph_builder.go", - "metrics.go", "operations.go", "patch.go", "rate_limiter_helper.go", @@ -31,7 +30,6 @@ go_library( "//pkg/util/workqueue/prometheus:go_default_library", "//vendor/github.com/golang/glog:go_default_library", "//vendor/github.com/golang/groupcache/lru:go_default_library", - "//vendor/github.com/prometheus/client_golang/prometheus:go_default_library", "//vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library", "//vendor/k8s.io/apimachinery/pkg/api/meta:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", @@ -39,7 +37,6 @@ go_library( "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", "//vendor/k8s.io/apimachinery/pkg/types:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/util/clock:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/errors:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/runtime:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/sets:go_default_library", diff --git a/pkg/controller/garbagecollector/garbagecollector.go b/pkg/controller/garbagecollector/garbagecollector.go index 785bcf3792f..0cd52024961 100644 --- a/pkg/controller/garbagecollector/garbagecollector.go +++ b/pkg/controller/garbagecollector/garbagecollector.go @@ -137,8 +137,6 @@ func (gc *GarbageCollector) Run(workers int, stopCh <-chan struct{}) { go wait.Until(gc.runAttemptToOrphanWorker, 1*time.Second, stopCh) } - Register() - <-stopCh } diff --git a/pkg/controller/garbagecollector/metrics.go b/pkg/controller/garbagecollector/metrics.go deleted file mode 100644 index 21eeafa4cb7..00000000000 --- a/pkg/controller/garbagecollector/metrics.go +++ /dev/null @@ -1,73 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package garbagecollector - -import ( - "sync" - "time" - - "k8s.io/apimachinery/pkg/util/clock" - - "github.com/prometheus/client_golang/prometheus" -) - -const ( - GarbageCollectSubsystem = "garbage_collector" - EventProcessingLatencyKey = "event_processing_latency_microseconds" - DirtyProcessingLatencyKey = "dirty_processing_latency_microseconds" - OrphanProcessingLatencyKey = "orphan_processing_latency_microseconds" -) - -var ( - EventProcessingLatency = prometheus.NewSummary( - prometheus.SummaryOpts{ - Subsystem: GarbageCollectSubsystem, - Name: EventProcessingLatencyKey, - Help: "Time in microseconds of an event spend in the eventQueue", - }, - ) - DirtyProcessingLatency = prometheus.NewSummary( - prometheus.SummaryOpts{ - Subsystem: GarbageCollectSubsystem, - Name: DirtyProcessingLatencyKey, - Help: "Time in microseconds of an item spend in the dirtyQueue", - }, - ) - OrphanProcessingLatency = prometheus.NewSummary( - prometheus.SummaryOpts{ - Subsystem: GarbageCollectSubsystem, - Name: OrphanProcessingLatencyKey, - Help: "Time in microseconds of an item spend in the orphanQueue", - }, - ) -) - -var registerMetrics sync.Once - -// Register all metrics. -func Register() { - // Register the metrics. - registerMetrics.Do(func() { - prometheus.MustRegister(EventProcessingLatency) - prometheus.MustRegister(DirtyProcessingLatency) - prometheus.MustRegister(OrphanProcessingLatency) - }) -} - -func sinceInMicroseconds(clock clock.Clock, start time.Time) float64 { - return float64(clock.Since(start).Nanoseconds() / time.Microsecond.Nanoseconds()) -}