apf: print watch init latency in httplog

This commit is contained in:
Abu Kashem 2021-10-01 10:18:19 -04:00
parent afd55590e2
commit 9b21e11cf9
No known key found for this signature in database
GPG Key ID: 33A4FA7088DB68A9

View File

@ -22,6 +22,7 @@ import (
"net/http"
"runtime"
"sync/atomic"
"time"
flowcontrol "k8s.io/api/flowcontrol/v1beta2"
apitypes "k8s.io/apimachinery/pkg/types"
@ -176,6 +177,10 @@ func WithPriorityAndFairness(
}()
execute := func() {
startedAt := time.Now()
defer func() {
httplog.AddKeyValue(ctx, "apf_init_latency", time.Now().Sub(startedAt))
}()
noteExecutingDelta(1)
defer noteExecutingDelta(-1)
served = true