mirror of https://github.com/knative/caching.git
upgrade to latest dependencies (#427)
bumping knative.dev/pkg 448ae65...84c98f3: > 84c98f3 remove reflector metrics (# 2020) > adbe77d Updates to the release process with 0.20 (# 1982) Signed-off-by: Knative Automation <automation@knative.team>
This commit is contained in:
parent
1212288570
commit
daa996f87c
2
go.mod
2
go.mod
|
@ -18,5 +18,5 @@ require (
|
|||
k8s.io/code-generator v0.19.7
|
||||
k8s.io/kube-openapi v0.0.0-20200805222855-6aeccd4b50c6
|
||||
knative.dev/hack v0.0.0-20210203173706-8368e1f6eacf
|
||||
knative.dev/pkg v0.0.0-20210212203835-448ae657fb5f
|
||||
knative.dev/pkg v0.0.0-20210215165523-84c98f3c3e7a
|
||||
)
|
||||
|
|
4
go.sum
4
go.sum
|
@ -1188,8 +1188,8 @@ k8s.io/utils v0.0.0-20200729134348-d5654de09c73 h1:uJmqzgNWG7XyClnU/mLPBWwfKKF1K
|
|||
k8s.io/utils v0.0.0-20200729134348-d5654de09c73/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
|
||||
knative.dev/hack v0.0.0-20210203173706-8368e1f6eacf h1:u4cY4jr2LYvhoz/1HBWEPsMiLkm0HMdDTfmmw1RE8zE=
|
||||
knative.dev/hack v0.0.0-20210203173706-8368e1f6eacf/go.mod h1:PHt8x8yX5Z9pPquBEfIj0X66f8iWkWfR0S/sarACJrI=
|
||||
knative.dev/pkg v0.0.0-20210212203835-448ae657fb5f h1:pz+UDOTsCIClHXGM/SgCzkctLxgi3+P0C26x6Ujlqho=
|
||||
knative.dev/pkg v0.0.0-20210212203835-448ae657fb5f/go.mod h1:TJSdebQOWX5N2bszohOYVi0H1QtXbtlYLuMghAFBMhY=
|
||||
knative.dev/pkg v0.0.0-20210215165523-84c98f3c3e7a h1:Jb8iKzfqhqwYoK9xHulmFdoscUBPLlXmBQMb2grTa78=
|
||||
knative.dev/pkg v0.0.0-20210215165523-84c98f3c3e7a/go.mod h1:TJSdebQOWX5N2bszohOYVi0H1QtXbtlYLuMghAFBMhY=
|
||||
pgregory.net/rapid v0.3.3/go.mod h1:UYpPVyjFHzYBGHIxLFoupi8vwk6rXNzRY9OMvVxFIOU=
|
||||
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
|
||||
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
|
||||
|
|
|
@ -26,7 +26,6 @@ import (
|
|||
"go.opencensus.io/tag"
|
||||
"go.uber.org/zap"
|
||||
"k8s.io/apimachinery/pkg/types"
|
||||
"k8s.io/client-go/tools/cache"
|
||||
kubemetrics "k8s.io/client-go/tools/metrics"
|
||||
"k8s.io/client-go/util/workqueue"
|
||||
"knative.dev/pkg/metrics"
|
||||
|
@ -93,59 +92,6 @@ func init() {
|
|||
}
|
||||
workqueue.SetProvider(wp)
|
||||
|
||||
// Register to receive metrics from kubernetes reflectors (what powers informers)
|
||||
// NOTE: today these don't actually seem to wire up to anything in Kubernetes.
|
||||
rp := &metrics.ReflectorProvider{
|
||||
ItemsInList: stats.Float64(
|
||||
"reflector_items_in_list",
|
||||
"How many items an API list returns to the reflectors",
|
||||
stats.UnitDimensionless,
|
||||
),
|
||||
// TODO(mattmoor): This is not in the latest version, so it will
|
||||
// be removed in a future version.
|
||||
ItemsInMatch: stats.Float64(
|
||||
"reflector_items_in_match",
|
||||
"",
|
||||
stats.UnitDimensionless,
|
||||
),
|
||||
ItemsInWatch: stats.Float64(
|
||||
"reflector_items_in_watch",
|
||||
"How many items an API watch returns to the reflectors",
|
||||
stats.UnitDimensionless,
|
||||
),
|
||||
LastResourceVersion: stats.Float64(
|
||||
"reflector_last_resource_version",
|
||||
"Last resource version seen for the reflectors",
|
||||
stats.UnitDimensionless,
|
||||
),
|
||||
ListDuration: stats.Float64(
|
||||
"reflector_list_duration_seconds",
|
||||
"How long an API list takes to return and decode for the reflectors",
|
||||
stats.UnitSeconds,
|
||||
),
|
||||
Lists: stats.Int64(
|
||||
"reflector_lists_total",
|
||||
"Total number of API lists done by the reflectors",
|
||||
stats.UnitDimensionless,
|
||||
),
|
||||
ShortWatches: stats.Int64(
|
||||
"reflector_short_watches_total",
|
||||
"Total number of short API watches done by the reflectors",
|
||||
stats.UnitDimensionless,
|
||||
),
|
||||
WatchDuration: stats.Float64(
|
||||
"reflector_watch_duration_seconds",
|
||||
"How long an API watch takes to return and decode for the reflectors",
|
||||
stats.UnitSeconds,
|
||||
),
|
||||
Watches: stats.Int64(
|
||||
"reflector_watches_total",
|
||||
"Total number of API watches done by the reflectors",
|
||||
stats.UnitDimensionless,
|
||||
),
|
||||
}
|
||||
cache.SetReflectorMetricsProvider(rp)
|
||||
|
||||
cp := &metrics.ClientProvider{
|
||||
Latency: stats.Float64(
|
||||
"client_latency",
|
||||
|
@ -181,7 +127,6 @@ func init() {
|
|||
TagKeys: []tag.Key{reconcilerTagKey, successTagKey, NamespaceTagKey},
|
||||
}}
|
||||
views = append(views, wp.DefaultViews()...)
|
||||
views = append(views, rp.DefaultViews()...)
|
||||
views = append(views, cp.DefaultViews()...)
|
||||
|
||||
// Create views to see our measurements. This can return an error if
|
||||
|
|
|
@ -1,176 +0,0 @@
|
|||
/*
|
||||
Copyright 2019 The Knative 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 metrics
|
||||
|
||||
import (
|
||||
"go.opencensus.io/stats"
|
||||
"go.opencensus.io/stats/view"
|
||||
"go.opencensus.io/tag"
|
||||
"k8s.io/client-go/tools/cache"
|
||||
)
|
||||
|
||||
// ReflectorProvider implements reflector.MetricsProvider and may be used with
|
||||
// reflector.SetProvider to have metrics exported to the provided metrics.
|
||||
type ReflectorProvider struct {
|
||||
ItemsInList *stats.Float64Measure
|
||||
// TODO(mattmoor): This is not in the latest version, so it will
|
||||
// be removed in a future version.
|
||||
ItemsInMatch *stats.Float64Measure
|
||||
ItemsInWatch *stats.Float64Measure
|
||||
LastResourceVersion *stats.Float64Measure
|
||||
ListDuration *stats.Float64Measure
|
||||
Lists *stats.Int64Measure
|
||||
ShortWatches *stats.Int64Measure
|
||||
WatchDuration *stats.Float64Measure
|
||||
Watches *stats.Int64Measure
|
||||
}
|
||||
|
||||
var (
|
||||
_ cache.MetricsProvider = (*ReflectorProvider)(nil)
|
||||
)
|
||||
|
||||
// NewItemsInListMetric implements MetricsProvider
|
||||
func (rp *ReflectorProvider) NewItemsInListMetric(name string) cache.SummaryMetric {
|
||||
return floatMetric{
|
||||
mutators: []tag.Mutator{tag.Insert(tagName, name)},
|
||||
measure: rp.ItemsInList,
|
||||
}
|
||||
}
|
||||
|
||||
// ItemsInListView returns a view of the ItemsInList metric.
|
||||
func (rp *ReflectorProvider) ItemsInListView() *view.View {
|
||||
return measureView(rp.ItemsInList, view.Distribution(BucketsNBy10(0.1, 6)...))
|
||||
}
|
||||
|
||||
// NewItemsInMatchMetric implements MetricsProvider
|
||||
func (rp *ReflectorProvider) NewItemsInMatchMetric(name string) cache.SummaryMetric {
|
||||
return floatMetric{
|
||||
mutators: []tag.Mutator{tag.Insert(tagName, name)},
|
||||
measure: rp.ItemsInMatch,
|
||||
}
|
||||
}
|
||||
|
||||
// ItemsInMatchView returns a view of the ItemsInMatch metric.
|
||||
func (rp *ReflectorProvider) ItemsInMatchView() *view.View {
|
||||
return measureView(rp.ItemsInMatch, view.Distribution(BucketsNBy10(0.1, 6)...))
|
||||
}
|
||||
|
||||
// NewItemsInWatchMetric implements MetricsProvider
|
||||
func (rp *ReflectorProvider) NewItemsInWatchMetric(name string) cache.SummaryMetric {
|
||||
return floatMetric{
|
||||
mutators: []tag.Mutator{tag.Insert(tagName, name)},
|
||||
measure: rp.ItemsInWatch,
|
||||
}
|
||||
}
|
||||
|
||||
// ItemsInWatchView returns a view of the ItemsInWatch metric.
|
||||
func (rp *ReflectorProvider) ItemsInWatchView() *view.View {
|
||||
return measureView(rp.ItemsInWatch, view.Distribution(BucketsNBy10(0.1, 6)...))
|
||||
}
|
||||
|
||||
// NewLastResourceVersionMetric implements MetricsProvider
|
||||
func (rp *ReflectorProvider) NewLastResourceVersionMetric(name string) cache.GaugeMetric {
|
||||
return floatMetric{
|
||||
mutators: []tag.Mutator{tag.Insert(tagName, name)},
|
||||
measure: rp.LastResourceVersion,
|
||||
}
|
||||
}
|
||||
|
||||
// LastResourceVersionView returns a view of the LastResourceVersion metric.
|
||||
func (rp *ReflectorProvider) LastResourceVersionView() *view.View {
|
||||
return measureView(rp.LastResourceVersion, view.LastValue())
|
||||
}
|
||||
|
||||
// NewListDurationMetric implements MetricsProvider
|
||||
func (rp *ReflectorProvider) NewListDurationMetric(name string) cache.SummaryMetric {
|
||||
return floatMetric{
|
||||
mutators: []tag.Mutator{tag.Insert(tagName, name)},
|
||||
measure: rp.ListDuration,
|
||||
}
|
||||
}
|
||||
|
||||
// ListDurationView returns a view of the ListDuration metric.
|
||||
func (rp *ReflectorProvider) ListDurationView() *view.View {
|
||||
return measureView(rp.ListDuration, view.Distribution(BucketsNBy10(0.1, 6)...))
|
||||
}
|
||||
|
||||
// NewListsMetric implements MetricsProvider
|
||||
func (rp *ReflectorProvider) NewListsMetric(name string) cache.CounterMetric {
|
||||
return counterMetric{
|
||||
mutators: []tag.Mutator{tag.Insert(tagName, name)},
|
||||
measure: rp.Lists,
|
||||
}
|
||||
}
|
||||
|
||||
// ListsView returns a view of the Lists metric.
|
||||
func (rp *ReflectorProvider) ListsView() *view.View {
|
||||
return measureView(rp.Lists, view.Count())
|
||||
}
|
||||
|
||||
// NewShortWatchesMetric implements MetricsProvider
|
||||
func (rp *ReflectorProvider) NewShortWatchesMetric(name string) cache.CounterMetric {
|
||||
return counterMetric{
|
||||
mutators: []tag.Mutator{tag.Insert(tagName, name)},
|
||||
measure: rp.ShortWatches,
|
||||
}
|
||||
}
|
||||
|
||||
// ShortWatchesView returns a view of the ShortWatches metric.
|
||||
func (rp *ReflectorProvider) ShortWatchesView() *view.View {
|
||||
return measureView(rp.ShortWatches, view.Count())
|
||||
}
|
||||
|
||||
// NewWatchDurationMetric implements MetricsProvider
|
||||
func (rp *ReflectorProvider) NewWatchDurationMetric(name string) cache.SummaryMetric {
|
||||
return floatMetric{
|
||||
mutators: []tag.Mutator{tag.Insert(tagName, name)},
|
||||
measure: rp.WatchDuration,
|
||||
}
|
||||
}
|
||||
|
||||
// WatchDurationView returns a view of the WatchDuration metric.
|
||||
func (rp *ReflectorProvider) WatchDurationView() *view.View {
|
||||
return measureView(rp.WatchDuration, view.Distribution(BucketsNBy10(0.1, 6)...))
|
||||
}
|
||||
|
||||
// NewWatchesMetric implements MetricsProvider
|
||||
func (rp *ReflectorProvider) NewWatchesMetric(name string) cache.CounterMetric {
|
||||
return counterMetric{
|
||||
mutators: []tag.Mutator{tag.Insert(tagName, name)},
|
||||
measure: rp.Watches,
|
||||
}
|
||||
}
|
||||
|
||||
// WatchesView returns a view of the Watches metric.
|
||||
func (rp *ReflectorProvider) WatchesView() *view.View {
|
||||
return measureView(rp.Watches, view.Count())
|
||||
}
|
||||
|
||||
// DefaultViews returns a list of views suitable for passing to view.Register
|
||||
func (rp *ReflectorProvider) DefaultViews() []*view.View {
|
||||
return []*view.View{
|
||||
rp.ItemsInListView(),
|
||||
rp.ItemsInMatchView(),
|
||||
rp.ItemsInWatchView(),
|
||||
rp.LastResourceVersionView(),
|
||||
rp.ListDurationView(),
|
||||
rp.ListsView(),
|
||||
rp.ShortWatchesView(),
|
||||
rp.WatchDurationView(),
|
||||
rp.WatchesView(),
|
||||
}
|
||||
}
|
|
@ -658,7 +658,7 @@ k8s.io/utils/trace
|
|||
# knative.dev/hack v0.0.0-20210203173706-8368e1f6eacf
|
||||
## explicit
|
||||
knative.dev/hack
|
||||
# knative.dev/pkg v0.0.0-20210212203835-448ae657fb5f
|
||||
# knative.dev/pkg v0.0.0-20210215165523-84c98f3c3e7a
|
||||
## explicit
|
||||
knative.dev/pkg/apis
|
||||
knative.dev/pkg/apis/duck
|
||||
|
|
Loading…
Reference in New Issue