Skip to content

Commit

Permalink
Remove deprecated ObservedPodCount metric (#4138)
Browse files Browse the repository at this point in the history
* Remove deprecated ObservedPodCount metric.

* Remove more unused code
  • Loading branch information
JRBANCEL authored and knative-prow-robot committed May 21, 2019
1 parent 5291b2a commit 888e492
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 23 deletions.
5 changes: 0 additions & 5 deletions pkg/autoscaler/autoscaler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,11 +220,6 @@ func (r *mockReporter) ReportActualPodCount(v int64) error {
return nil
}

// ReportObservedPodCount of a mockReporter does nothing and return nil for error.
func (r *mockReporter) ReportObservedPodCount(v float64) error {
return nil
}

// ReportStableRequestConcurrency of a mockReporter does nothing and return nil for error.
func (r *mockReporter) ReportStableRequestConcurrency(v float64) error {
return nil
Expand Down
16 changes: 0 additions & 16 deletions pkg/autoscaler/stats_reporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@ var (
"actual_pods",
"Number of pods that are allocated currently",
stats.UnitDimensionless)
observedPodCountM = stats.Float64(
"observed_pods",
"Number of pods that are observed currently",
stats.UnitDimensionless)
stableRequestConcurrencyM = stats.Float64(
"stable_request_concurrency",
"Average of requests count per observed pod in each stable window (default 60 seconds)",
Expand Down Expand Up @@ -113,12 +109,6 @@ func init() {
Aggregation: view.LastValue(),
TagKeys: []tag.Key{namespaceTagKey, serviceTagKey, configTagKey, revisionTagKey},
},
&view.View{
Description: "Number of pods that are observed currently",
Measure: observedPodCountM,
Aggregation: view.LastValue(),
TagKeys: []tag.Key{namespaceTagKey, serviceTagKey, configTagKey, revisionTagKey},
},
&view.View{
Description: "Average of requests count in each 60 second stable window",
Measure: stableRequestConcurrencyM,
Expand Down Expand Up @@ -155,7 +145,6 @@ type StatsReporter interface {
ReportDesiredPodCount(v int64) error
ReportRequestedPodCount(v int64) error
ReportActualPodCount(v int64) error
ReportObservedPodCount(v float64) error
ReportStableRequestConcurrency(v float64) error
ReportPanicRequestConcurrency(v float64) error
ReportTargetRequestConcurrency(v float64) error
Expand Down Expand Up @@ -213,11 +202,6 @@ func (r *Reporter) ReportActualPodCount(v int64) error {
return r.report(actualPodCountM.M(v))
}

// ReportObservedPodCount captures value v for observed pod count measure.
func (r *Reporter) ReportObservedPodCount(v float64) error {
return r.report(observedPodCountM.M(v))
}

// ReportStableRequestConcurrency captures value v for stable request concurrency measure.
func (r *Reporter) ReportStableRequestConcurrency(v float64) error {
return r.report(stableRequestConcurrencyM.M(v))
Expand Down
2 changes: 0 additions & 2 deletions pkg/autoscaler/stats_reporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,13 @@ func TestReporter_Report(t *testing.T) {
expectSuccess(t, "ReportRequestedPodCount", func() error { return r.ReportRequestedPodCount(7) })
expectSuccess(t, "ReportActualPodCount", func() error { return r.ReportActualPodCount(5) })
expectSuccess(t, "ReportPanic", func() error { return r.ReportPanic(0) })
expectSuccess(t, "ReportObservedPodCount", func() error { return r.ReportObservedPodCount(1) })
expectSuccess(t, "ReportStableRequestConcurrency", func() error { return r.ReportStableRequestConcurrency(2) })
expectSuccess(t, "ReportPanicRequestConcurrency", func() error { return r.ReportPanicRequestConcurrency(3) })
expectSuccess(t, "ReportTargetRequestConcurrency", func() error { return r.ReportTargetRequestConcurrency(0.9) })
assertData(t, "desired_pods", wantTags, 10)
assertData(t, "requested_pods", wantTags, 7)
assertData(t, "actual_pods", wantTags, 5)
assertData(t, "panic_mode", wantTags, 0)
assertData(t, "observed_pods", wantTags, 1)
assertData(t, "stable_request_concurrency", wantTags, 2)
assertData(t, "panic_request_concurrency", wantTags, 3)
assertData(t, "target_concurrency_per_pod", wantTags, 0.9)
Expand Down

0 comments on commit 888e492

Please sign in to comment.