Disable P&F for watch requests
This commit is contained in:
		@@ -41,6 +41,12 @@ const (
 | 
				
			|||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func (e *mutatingWorkEstimator) estimate(r *http.Request) WorkEstimate {
 | 
					func (e *mutatingWorkEstimator) estimate(r *http.Request) WorkEstimate {
 | 
				
			||||||
 | 
						// TODO(wojtekt): Remove once we tune the algorithm to not fail
 | 
				
			||||||
 | 
						// scalability tests.
 | 
				
			||||||
 | 
						return WorkEstimate{
 | 
				
			||||||
 | 
							InitialSeats: 1,
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	requestInfo, ok := apirequest.RequestInfoFrom(r.Context())
 | 
						requestInfo, ok := apirequest.RequestInfoFrom(r.Context())
 | 
				
			||||||
	if !ok {
 | 
						if !ok {
 | 
				
			||||||
		// no RequestInfo should never happen, but to be on the safe side
 | 
							// no RequestInfo should never happen, but to be on the safe side
 | 
				
			||||||
@@ -51,7 +57,6 @@ func (e *mutatingWorkEstimator) estimate(r *http.Request) WorkEstimate {
 | 
				
			|||||||
			AdditionalLatency: eventAdditionalDuration,
 | 
								AdditionalLatency: eventAdditionalDuration,
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					 | 
				
			||||||
	watchCount := e.countFn(requestInfo)
 | 
						watchCount := e.countFn(requestInfo)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// The cost of the request associated with the watchers of that event
 | 
						// The cost of the request associated with the watchers of that event
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -252,6 +252,9 @@ func TestWorkEstimator(t *testing.T) {
 | 
				
			|||||||
			countErr:             errors.New("unknown error"),
 | 
								countErr:             errors.New("unknown error"),
 | 
				
			||||||
			initialSeatsExpected: maximumSeats,
 | 
								initialSeatsExpected: maximumSeats,
 | 
				
			||||||
		},
 | 
							},
 | 
				
			||||||
 | 
							// TODO(wojtekt): Reenable these tests after tuning algorithm to
 | 
				
			||||||
 | 
							// not fail scalability tests.
 | 
				
			||||||
 | 
							/*
 | 
				
			||||||
			{
 | 
								{
 | 
				
			||||||
				name:       "request verb is create, no watches",
 | 
									name:       "request verb is create, no watches",
 | 
				
			||||||
				requestURI: "http://server/apis/foo.bar/v1/foos",
 | 
									requestURI: "http://server/apis/foo.bar/v1/foos",
 | 
				
			||||||
@@ -378,6 +381,7 @@ func TestWorkEstimator(t *testing.T) {
 | 
				
			|||||||
				finalSeatsExpected:        3,
 | 
									finalSeatsExpected:        3,
 | 
				
			||||||
				additionalLatencyExpected: 5 * time.Millisecond,
 | 
									additionalLatencyExpected: 5 * time.Millisecond,
 | 
				
			||||||
			},
 | 
								},
 | 
				
			||||||
 | 
							*/
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	for _, test := range tests {
 | 
						for _, test := range tests {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user