apf: print watch init latency in httplog
This commit is contained in:
		@@ -22,6 +22,7 @@ import (
 | 
				
			|||||||
	"net/http"
 | 
						"net/http"
 | 
				
			||||||
	"runtime"
 | 
						"runtime"
 | 
				
			||||||
	"sync/atomic"
 | 
						"sync/atomic"
 | 
				
			||||||
 | 
						"time"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	flowcontrol "k8s.io/api/flowcontrol/v1beta2"
 | 
						flowcontrol "k8s.io/api/flowcontrol/v1beta2"
 | 
				
			||||||
	apitypes "k8s.io/apimachinery/pkg/types"
 | 
						apitypes "k8s.io/apimachinery/pkg/types"
 | 
				
			||||||
@@ -176,6 +177,10 @@ func WithPriorityAndFairness(
 | 
				
			|||||||
			}()
 | 
								}()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			execute := func() {
 | 
								execute := func() {
 | 
				
			||||||
 | 
									startedAt := time.Now()
 | 
				
			||||||
 | 
									defer func() {
 | 
				
			||||||
 | 
										httplog.AddKeyValue(ctx, "apf_init_latency", time.Now().Sub(startedAt))
 | 
				
			||||||
 | 
									}()
 | 
				
			||||||
				noteExecutingDelta(1)
 | 
									noteExecutingDelta(1)
 | 
				
			||||||
				defer noteExecutingDelta(-1)
 | 
									defer noteExecutingDelta(-1)
 | 
				
			||||||
				served = true
 | 
									served = true
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user