mirror of https://github.com/k3s-io/k3s
Merge pull request #4905 from vmarmol/mon-sync-pods
Adding metric for latency of SyncPods (synching all pods).pull/6/head
commit
014156195c
|
@ -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.
|
||||
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)
|
||||
var err error
|
||||
desiredContainers := make(map[podContainer]empty)
|
||||
|
|
|
@ -45,8 +45,14 @@ var (
|
|||
},
|
||||
[]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): Latency of SyncPods
|
||||
DockerOperationsLatency = prometheus.NewSummaryVec(
|
||||
prometheus.SummaryOpts{
|
||||
Subsystem: kubeletSubsystem,
|
||||
|
@ -66,6 +72,7 @@ func Register(containerCache dockertools.DockerCache) {
|
|||
prometheus.MustRegister(ImagePullLatency)
|
||||
prometheus.MustRegister(SyncPodLatency)
|
||||
prometheus.MustRegister(DockerOperationsLatency)
|
||||
prometheus.MustRegister(SyncPodsLatency)
|
||||
prometheus.MustRegister(newPodAndContainerCollector(containerCache))
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue