@@ -34,14 +34,25 @@ import (
34
34
clientset "k8s.io/client-go/kubernetes"
35
35
restclient "k8s.io/client-go/rest"
36
36
kubeletstatsv1alpha1 "k8s.io/kubernetes/pkg/kubelet/apis/stats/v1alpha1"
37
- dockermetrics "k8s.io/kubernetes/pkg/kubelet/dockershim/metrics"
38
37
"k8s.io/kubernetes/test/e2e/framework"
39
38
e2emetrics "k8s.io/kubernetes/test/e2e/framework/metrics"
40
39
)
41
40
42
41
const (
43
42
// timeout for proxy requests.
44
43
proxyTimeout = 2 * time .Minute
44
+
45
+ // dockerOperationsKey is the key for docker operation metrics.
46
+ // copied from k8s.io/kubernetes/pkg/kubelet/dockershim/metrics
47
+ dockerOperationsKey = "docker_operations_total"
48
+
49
+ // dockerOperationsErrorsKey is the key for the operation error metrics.
50
+ // copied from k8s.io/kubernetes/pkg/kubelet/dockershim/metrics
51
+ dockerOperationsErrorsKey = "docker_operations_errors_total"
52
+
53
+ // dockerOperationsTimeoutKey is the key for the operation timeout metrics.
54
+ // copied from k8s.io/kubernetes/pkg/kubelet/dockershim/metrics
55
+ dockerOperationsTimeoutKey = "docker_operations_timeout_total"
45
56
)
46
57
47
58
// ContainerResourceUsage is a structure for gathering container resource usage.
@@ -190,9 +201,9 @@ func getNodeRuntimeOperationErrorRate(c clientset.Interface, node string) (NodeR
190
201
}
191
202
// If no corresponding metrics are found, the returned samples will be empty. Then the following
192
203
// loop will be skipped automatically.
193
- allOps := ms [dockermetrics . DockerOperationsKey ]
194
- errOps := ms [dockermetrics . DockerOperationsErrorsKey ]
195
- timeoutOps := ms [dockermetrics . DockerOperationsTimeoutKey ]
204
+ allOps := ms [dockerOperationsKey ]
205
+ errOps := ms [dockerOperationsErrorsKey ]
206
+ timeoutOps := ms [dockerOperationsTimeoutKey ]
196
207
for _ , sample := range allOps {
197
208
operation := string (sample .Metric ["operation_type" ])
198
209
result [operation ] = & RuntimeOperationErrorRate {TotalNumber : float64 (sample .Value )}
0 commit comments