mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 12:43:23 +00:00
apf: print watch init latency in httplog
This commit is contained in:
parent
afd55590e2
commit
9b21e11cf9
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user