mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 20:24:09 +00:00
Adding metric for latency of SyncPods (synching all pods).
This commit is contained in:
parent
1444e59fc9
commit
a9301b1996
@ -1275,6 +1275,9 @@ func (kl *Kubelet) cleanupOrphanedVolumes(pods []api.BoundPod, running []*docker
|
|||||||
|
|
||||||
// SyncPods synchronizes the configured list of pods (desired state) with the host current state.
|
// SyncPods synchronizes the configured list of pods (desired state) with the host current state.
|
||||||
func (kl *Kubelet) SyncPods(pods []api.BoundPod, podSyncTypes map[types.UID]metrics.SyncPodType, start time.Time) error {
|
func (kl *Kubelet) SyncPods(pods []api.BoundPod, podSyncTypes map[types.UID]metrics.SyncPodType, start time.Time) error {
|
||||||
|
defer func() {
|
||||||
|
metrics.SyncPodsLatency.Observe(metrics.SinceInMicroseconds(start))
|
||||||
|
}()
|
||||||
glog.V(4).Infof("Desired: %#v", pods)
|
glog.V(4).Infof("Desired: %#v", pods)
|
||||||
var err error
|
var err error
|
||||||
desiredContainers := make(map[podContainer]empty)
|
desiredContainers := make(map[podContainer]empty)
|
||||||
|
@ -45,8 +45,14 @@ var (
|
|||||||
},
|
},
|
||||||
[]string{"operation_type"},
|
[]string{"operation_type"},
|
||||||
)
|
)
|
||||||
|
SyncPodsLatency = prometheus.NewSummary(
|
||||||
|
prometheus.SummaryOpts{
|
||||||
|
Subsystem: kubeletSubsystem,
|
||||||
|
Name: "sync_pods_latency_microseconds",
|
||||||
|
Help: "Latency in microseconds to sync all pods.",
|
||||||
|
},
|
||||||
|
)
|
||||||
// TODO(vmarmol): Containers per pod
|
// TODO(vmarmol): Containers per pod
|
||||||
// TODO(vmarmol): Latency of SyncPods
|
|
||||||
DockerOperationsLatency = prometheus.NewSummaryVec(
|
DockerOperationsLatency = prometheus.NewSummaryVec(
|
||||||
prometheus.SummaryOpts{
|
prometheus.SummaryOpts{
|
||||||
Subsystem: kubeletSubsystem,
|
Subsystem: kubeletSubsystem,
|
||||||
@ -66,6 +72,7 @@ func Register(containerCache dockertools.DockerCache) {
|
|||||||
prometheus.MustRegister(ImagePullLatency)
|
prometheus.MustRegister(ImagePullLatency)
|
||||||
prometheus.MustRegister(SyncPodLatency)
|
prometheus.MustRegister(SyncPodLatency)
|
||||||
prometheus.MustRegister(DockerOperationsLatency)
|
prometheus.MustRegister(DockerOperationsLatency)
|
||||||
|
prometheus.MustRegister(SyncPodsLatency)
|
||||||
prometheus.MustRegister(newPodAndContainerCollector(containerCache))
|
prometheus.MustRegister(newPodAndContainerCollector(containerCache))
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user