Remove ImagePull metric in Kubelet.

There is an equivalent metric from our Docker metrics and this one is
harder to maintain with the RuntimeHooks.
This commit is contained in:
Victor Marmol 2015-04-29 13:58:29 -07:00
parent 2a01a2c7e9
commit 090d0c95fa
3 changed files with 5 additions and 13 deletions

View File

@ -86,7 +86,7 @@ type RuntimeHooks interface {
// Determines whether the runtime should pull the specified container's image.
ShouldPullImage(pod *api.Pod, container *api.Container, imagePresent bool) bool
// Runs after an image is pulled reporting it's status. Error may be nil
// Runs after an image is pulled reporting its status. Error may be nil
// for a successful pull.
ReportImagePull(pod *api.Pod, container *api.Container, err error)
}

View File

@ -28,13 +28,6 @@ import (
const kubeletSubsystem = "kubelet"
var (
ImagePullLatency = prometheus.NewSummary(
prometheus.SummaryOpts{
Subsystem: kubeletSubsystem,
Name: "image_pull_latency_microseconds",
Help: "Image pull latency in microseconds.",
},
)
ContainersPerPodCount = prometheus.NewSummary(
prometheus.SummaryOpts{
Subsystem: kubeletSubsystem,
@ -73,7 +66,6 @@ var registerMetrics sync.Once
func Register(containerCache kubecontainer.RuntimeCache) {
// Register the metrics.
registerMetrics.Do(func() {
prometheus.MustRegister(ImagePullLatency)
prometheus.MustRegister(SyncPodLatency)
prometheus.MustRegister(DockerOperationsLatency)
prometheus.MustRegister(SyncPodsLatency)

View File

@ -49,15 +49,15 @@ func (kr *kubeletRuntimeHooks) ShouldPullImage(pod *api.Pod, container *api.Cont
return false
}
func (kr *kubeletRuntimeHooks) ReportImagePull(pod *api.Pod, container *api.Container, err error) {
func (kr *kubeletRuntimeHooks) ReportImagePull(pod *api.Pod, container *api.Container, pullError error) {
ref, err := kubecontainer.GenerateContainerRef(pod, container)
if err != nil {
glog.Errorf("Couldn't make a ref to pod %v, container %v: '%v'", pod.Name, container.Name, err)
glog.Errorf("Couldn't make a ref to pod %q, container %q: '%v'", pod.Name, container.Name, err)
return
}
if err != nil {
kr.recorder.Eventf(ref, "failed", "Failed to pull image %q: %v", container.Image, err)
if pullError != nil {
kr.recorder.Eventf(ref, "failed", "Failed to pull image %q: %v", container.Image, pullError)
} else {
kr.recorder.Eventf(ref, "pulled", "Successfully pulled image %q", container.Image)
}