Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
0b01b9ce
Unverified
Commit
0b01b9ce
authored
Feb 18, 2019
by
Kubernetes Prow Robot
Committed by
GitHub
Feb 18, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #72470 from danielqsj/kl
Change kubelet metrics to conform metrics guidelines
parents
cbcc2b26
79a3eb81
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
40 additions
and
26 deletions
+40
-26
cgroup_manager_linux.go
pkg/kubelet/cm/cgroup_manager_linux.go
+6
-3
manager.go
pkg/kubelet/cm/devicemanager/manager.go
+3
-1
eviction_manager.go
pkg/kubelet/eviction/eviction_manager.go
+2
-1
kubelet.go
pkg/kubelet/kubelet.go
+6
-3
instrumented_services.go
pkg/kubelet/kuberuntime/instrumented_services.go
+4
-1
instrumented_services_test.go
pkg/kubelet/kuberuntime/instrumented_services_test.go
+4
-4
metrics.go
pkg/kubelet/metrics/metrics.go
+0
-0
generic.go
pkg/kubelet/pleg/generic.go
+4
-2
kubelet_stats.go
test/e2e/framework/kubelet_stats.go
+5
-5
metrics_util.go
test/e2e/framework/metrics_util.go
+3
-3
density_test.go
test/e2e_node/density_test.go
+2
-2
gpu_device_plugin.go
test/e2e_node/gpu_device_plugin.go
+1
-1
No files found.
pkg/kubelet/cm/cgroup_manager_linux.go
View file @
0b01b9ce
...
@@ -284,7 +284,8 @@ func (m *cgroupManagerImpl) Exists(name CgroupName) bool {
...
@@ -284,7 +284,8 @@ func (m *cgroupManagerImpl) Exists(name CgroupName) bool {
func
(
m
*
cgroupManagerImpl
)
Destroy
(
cgroupConfig
*
CgroupConfig
)
error
{
func
(
m
*
cgroupManagerImpl
)
Destroy
(
cgroupConfig
*
CgroupConfig
)
error
{
start
:=
time
.
Now
()
start
:=
time
.
Now
()
defer
func
()
{
defer
func
()
{
metrics
.
CgroupManagerLatency
.
WithLabelValues
(
"destroy"
)
.
Observe
(
metrics
.
SinceInMicroseconds
(
start
))
metrics
.
CgroupManagerDuration
.
WithLabelValues
(
"destroy"
)
.
Observe
(
metrics
.
SinceInSeconds
(
start
))
metrics
.
DeprecatedCgroupManagerLatency
.
WithLabelValues
(
"destroy"
)
.
Observe
(
metrics
.
SinceInMicroseconds
(
start
))
}()
}()
cgroupPaths
:=
m
.
buildCgroupPaths
(
cgroupConfig
.
Name
)
cgroupPaths
:=
m
.
buildCgroupPaths
(
cgroupConfig
.
Name
)
...
@@ -411,7 +412,8 @@ func (m *cgroupManagerImpl) toResources(resourceConfig *ResourceConfig) *libcont
...
@@ -411,7 +412,8 @@ func (m *cgroupManagerImpl) toResources(resourceConfig *ResourceConfig) *libcont
func
(
m
*
cgroupManagerImpl
)
Update
(
cgroupConfig
*
CgroupConfig
)
error
{
func
(
m
*
cgroupManagerImpl
)
Update
(
cgroupConfig
*
CgroupConfig
)
error
{
start
:=
time
.
Now
()
start
:=
time
.
Now
()
defer
func
()
{
defer
func
()
{
metrics
.
CgroupManagerLatency
.
WithLabelValues
(
"update"
)
.
Observe
(
metrics
.
SinceInMicroseconds
(
start
))
metrics
.
CgroupManagerDuration
.
WithLabelValues
(
"update"
)
.
Observe
(
metrics
.
SinceInSeconds
(
start
))
metrics
.
DeprecatedCgroupManagerLatency
.
WithLabelValues
(
"update"
)
.
Observe
(
metrics
.
SinceInMicroseconds
(
start
))
}()
}()
// Extract the cgroup resource parameters
// Extract the cgroup resource parameters
...
@@ -446,7 +448,8 @@ func (m *cgroupManagerImpl) Update(cgroupConfig *CgroupConfig) error {
...
@@ -446,7 +448,8 @@ func (m *cgroupManagerImpl) Update(cgroupConfig *CgroupConfig) error {
func
(
m
*
cgroupManagerImpl
)
Create
(
cgroupConfig
*
CgroupConfig
)
error
{
func
(
m
*
cgroupManagerImpl
)
Create
(
cgroupConfig
*
CgroupConfig
)
error
{
start
:=
time
.
Now
()
start
:=
time
.
Now
()
defer
func
()
{
defer
func
()
{
metrics
.
CgroupManagerLatency
.
WithLabelValues
(
"create"
)
.
Observe
(
metrics
.
SinceInMicroseconds
(
start
))
metrics
.
CgroupManagerDuration
.
WithLabelValues
(
"create"
)
.
Observe
(
metrics
.
SinceInSeconds
(
start
))
metrics
.
DeprecatedCgroupManagerLatency
.
WithLabelValues
(
"create"
)
.
Observe
(
metrics
.
SinceInMicroseconds
(
start
))
}()
}()
resources
:=
m
.
toResources
(
cgroupConfig
.
ResourceParameters
)
resources
:=
m
.
toResources
(
cgroupConfig
.
ResourceParameters
)
...
...
pkg/kubelet/cm/devicemanager/manager.go
View file @
0b01b9ce
...
@@ -354,6 +354,7 @@ func (m *ManagerImpl) Allocate(node *schedulernodeinfo.NodeInfo, attrs *lifecycl
...
@@ -354,6 +354,7 @@ func (m *ManagerImpl) Allocate(node *schedulernodeinfo.NodeInfo, attrs *lifecycl
func
(
m
*
ManagerImpl
)
Register
(
ctx
context
.
Context
,
r
*
pluginapi
.
RegisterRequest
)
(
*
pluginapi
.
Empty
,
error
)
{
func
(
m
*
ManagerImpl
)
Register
(
ctx
context
.
Context
,
r
*
pluginapi
.
RegisterRequest
)
(
*
pluginapi
.
Empty
,
error
)
{
klog
.
Infof
(
"Got registration request from device plugin with resource name %q"
,
r
.
ResourceName
)
klog
.
Infof
(
"Got registration request from device plugin with resource name %q"
,
r
.
ResourceName
)
metrics
.
DevicePluginRegistrationCount
.
WithLabelValues
(
r
.
ResourceName
)
.
Inc
()
metrics
.
DevicePluginRegistrationCount
.
WithLabelValues
(
r
.
ResourceName
)
.
Inc
()
metrics
.
DeprecatedDevicePluginRegistrationCount
.
WithLabelValues
(
r
.
ResourceName
)
.
Inc
()
var
versionCompatible
bool
var
versionCompatible
bool
for
_
,
v
:=
range
pluginapi
.
SupportedVersions
{
for
_
,
v
:=
range
pluginapi
.
SupportedVersions
{
if
r
.
Version
==
v
{
if
r
.
Version
==
v
{
...
@@ -696,7 +697,8 @@ func (m *ManagerImpl) allocateContainerResources(pod *v1.Pod, container *v1.Cont
...
@@ -696,7 +697,8 @@ func (m *ManagerImpl) allocateContainerResources(pod *v1.Pod, container *v1.Cont
// in a passed in AllocateRequest pointer, and issues a single Allocate call per pod.
// in a passed in AllocateRequest pointer, and issues a single Allocate call per pod.
klog
.
V
(
3
)
.
Infof
(
"Making allocation request for devices %v for device plugin %s"
,
devs
,
resource
)
klog
.
V
(
3
)
.
Infof
(
"Making allocation request for devices %v for device plugin %s"
,
devs
,
resource
)
resp
,
err
:=
eI
.
e
.
allocate
(
devs
)
resp
,
err
:=
eI
.
e
.
allocate
(
devs
)
metrics
.
DevicePluginAllocationLatency
.
WithLabelValues
(
resource
)
.
Observe
(
metrics
.
SinceInMicroseconds
(
startRPCTime
))
metrics
.
DevicePluginAllocationDuration
.
WithLabelValues
(
resource
)
.
Observe
(
metrics
.
SinceInSeconds
(
startRPCTime
))
metrics
.
DeprecatedDevicePluginAllocationLatency
.
WithLabelValues
(
resource
)
.
Observe
(
metrics
.
SinceInMicroseconds
(
startRPCTime
))
if
err
!=
nil
{
if
err
!=
nil
{
// In case of allocation failure, we want to restore m.allocatedDevices
// In case of allocation failure, we want to restore m.allocatedDevices
// to the actual allocated state from m.podDevices.
// to the actual allocated state from m.podDevices.
...
...
pkg/kubelet/eviction/eviction_manager.go
View file @
0b01b9ce
...
@@ -361,7 +361,8 @@ func (m *managerImpl) synchronize(diskInfoProvider DiskInfoProvider, podFunc Act
...
@@ -361,7 +361,8 @@ func (m *managerImpl) synchronize(diskInfoProvider DiskInfoProvider, podFunc Act
for
_
,
t
:=
range
thresholds
{
for
_
,
t
:=
range
thresholds
{
timeObserved
:=
observations
[
t
.
Signal
]
.
time
timeObserved
:=
observations
[
t
.
Signal
]
.
time
if
!
timeObserved
.
IsZero
()
{
if
!
timeObserved
.
IsZero
()
{
metrics
.
EvictionStatsAge
.
WithLabelValues
(
string
(
t
.
Signal
))
.
Observe
(
metrics
.
SinceInMicroseconds
(
timeObserved
.
Time
))
metrics
.
EvictionStatsAge
.
WithLabelValues
(
string
(
t
.
Signal
))
.
Observe
(
metrics
.
SinceInSeconds
(
timeObserved
.
Time
))
metrics
.
DeprecatedEvictionStatsAge
.
WithLabelValues
(
string
(
t
.
Signal
))
.
Observe
(
metrics
.
SinceInMicroseconds
(
timeObserved
.
Time
))
}
}
}
}
...
...
pkg/kubelet/kubelet.go
View file @
0b01b9ce
...
@@ -1500,7 +1500,8 @@ func (kl *Kubelet) syncPod(o syncPodOptions) error {
...
@@ -1500,7 +1500,8 @@ func (kl *Kubelet) syncPod(o syncPodOptions) error {
if
!
firstSeenTime
.
IsZero
()
{
if
!
firstSeenTime
.
IsZero
()
{
// This is the first time we are syncing the pod. Record the latency
// This is the first time we are syncing the pod. Record the latency
// since kubelet first saw the pod if firstSeenTime is set.
// since kubelet first saw the pod if firstSeenTime is set.
metrics
.
PodWorkerStartLatency
.
Observe
(
metrics
.
SinceInMicroseconds
(
firstSeenTime
))
metrics
.
PodWorkerStartDuration
.
Observe
(
metrics
.
SinceInSeconds
(
firstSeenTime
))
metrics
.
DeprecatedPodWorkerStartLatency
.
Observe
(
metrics
.
SinceInMicroseconds
(
firstSeenTime
))
}
else
{
}
else
{
klog
.
V
(
3
)
.
Infof
(
"First seen time not recorded for pod %q"
,
pod
.
UID
)
klog
.
V
(
3
)
.
Infof
(
"First seen time not recorded for pod %q"
,
pod
.
UID
)
}
}
...
@@ -1517,7 +1518,8 @@ func (kl *Kubelet) syncPod(o syncPodOptions) error {
...
@@ -1517,7 +1518,8 @@ func (kl *Kubelet) syncPod(o syncPodOptions) error {
existingStatus
,
ok
:=
kl
.
statusManager
.
GetPodStatus
(
pod
.
UID
)
existingStatus
,
ok
:=
kl
.
statusManager
.
GetPodStatus
(
pod
.
UID
)
if
!
ok
||
existingStatus
.
Phase
==
v1
.
PodPending
&&
apiPodStatus
.
Phase
==
v1
.
PodRunning
&&
if
!
ok
||
existingStatus
.
Phase
==
v1
.
PodPending
&&
apiPodStatus
.
Phase
==
v1
.
PodRunning
&&
!
firstSeenTime
.
IsZero
()
{
!
firstSeenTime
.
IsZero
()
{
metrics
.
PodStartLatency
.
Observe
(
metrics
.
SinceInMicroseconds
(
firstSeenTime
))
metrics
.
PodStartDuration
.
Observe
(
metrics
.
SinceInSeconds
(
firstSeenTime
))
metrics
.
DeprecatedPodStartLatency
.
Observe
(
metrics
.
SinceInMicroseconds
(
firstSeenTime
))
}
}
runnable
:=
kl
.
canRunPod
(
pod
)
runnable
:=
kl
.
canRunPod
(
pod
)
...
@@ -1996,7 +1998,8 @@ func (kl *Kubelet) dispatchWork(pod *v1.Pod, syncType kubetypes.SyncPodType, mir
...
@@ -1996,7 +1998,8 @@ func (kl *Kubelet) dispatchWork(pod *v1.Pod, syncType kubetypes.SyncPodType, mir
UpdateType
:
syncType
,
UpdateType
:
syncType
,
OnCompleteFunc
:
func
(
err
error
)
{
OnCompleteFunc
:
func
(
err
error
)
{
if
err
!=
nil
{
if
err
!=
nil
{
metrics
.
PodWorkerLatency
.
WithLabelValues
(
syncType
.
String
())
.
Observe
(
metrics
.
SinceInMicroseconds
(
start
))
metrics
.
PodWorkerDuration
.
WithLabelValues
(
syncType
.
String
())
.
Observe
(
metrics
.
SinceInSeconds
(
start
))
metrics
.
DeprecatedPodWorkerLatency
.
WithLabelValues
(
syncType
.
String
())
.
Observe
(
metrics
.
SinceInMicroseconds
(
start
))
}
}
},
},
})
})
...
...
pkg/kubelet/kuberuntime/instrumented_services.go
View file @
0b01b9ce
...
@@ -49,13 +49,16 @@ func newInstrumentedImageManagerService(service internalapi.ImageManagerService)
...
@@ -49,13 +49,16 @@ func newInstrumentedImageManagerService(service internalapi.ImageManagerService)
// recordOperation records the duration of the operation.
// recordOperation records the duration of the operation.
func
recordOperation
(
operation
string
,
start
time
.
Time
)
{
func
recordOperation
(
operation
string
,
start
time
.
Time
)
{
metrics
.
RuntimeOperations
.
WithLabelValues
(
operation
)
.
Inc
()
metrics
.
RuntimeOperations
.
WithLabelValues
(
operation
)
.
Inc
()
metrics
.
RuntimeOperationsLatency
.
WithLabelValues
(
operation
)
.
Observe
(
metrics
.
SinceInMicroseconds
(
start
))
metrics
.
DeprecatedRuntimeOperations
.
WithLabelValues
(
operation
)
.
Inc
()
metrics
.
RuntimeOperationsDuration
.
WithLabelValues
(
operation
)
.
Observe
(
metrics
.
SinceInSeconds
(
start
))
metrics
.
DeprecatedRuntimeOperationsLatency
.
WithLabelValues
(
operation
)
.
Observe
(
metrics
.
SinceInMicroseconds
(
start
))
}
}
// recordError records error for metric if an error occurred.
// recordError records error for metric if an error occurred.
func
recordError
(
operation
string
,
err
error
)
{
func
recordError
(
operation
string
,
err
error
)
{
if
err
!=
nil
{
if
err
!=
nil
{
metrics
.
RuntimeOperationsErrors
.
WithLabelValues
(
operation
)
.
Inc
()
metrics
.
RuntimeOperationsErrors
.
WithLabelValues
(
operation
)
.
Inc
()
metrics
.
DeprecatedRuntimeOperationsErrors
.
WithLabelValues
(
operation
)
.
Inc
()
}
}
}
}
...
...
pkg/kubelet/kuberuntime/instrumented_services_test.go
View file @
0b01b9ce
...
@@ -30,7 +30,7 @@ import (
...
@@ -30,7 +30,7 @@ import (
func
TestRecordOperation
(
t
*
testing
.
T
)
{
func
TestRecordOperation
(
t
*
testing
.
T
)
{
prometheus
.
MustRegister
(
metrics
.
RuntimeOperations
)
prometheus
.
MustRegister
(
metrics
.
RuntimeOperations
)
prometheus
.
MustRegister
(
metrics
.
RuntimeOperations
Latency
)
prometheus
.
MustRegister
(
metrics
.
RuntimeOperations
Duration
)
prometheus
.
MustRegister
(
metrics
.
RuntimeOperationsErrors
)
prometheus
.
MustRegister
(
metrics
.
RuntimeOperationsErrors
)
temporalServer
:=
"127.0.0.1:1234"
temporalServer
:=
"127.0.0.1:1234"
...
@@ -50,8 +50,8 @@ func TestRecordOperation(t *testing.T) {
...
@@ -50,8 +50,8 @@ func TestRecordOperation(t *testing.T) {
}()
}()
recordOperation
(
"create_container"
,
time
.
Now
())
recordOperation
(
"create_container"
,
time
.
Now
())
runtimeOperationsCounterExpected
:=
"kubelet_runtime_operations{operation_type=
\"
create_container
\"
} 1"
runtimeOperationsCounterExpected
:=
"kubelet_runtime_operations
_total
{operation_type=
\"
create_container
\"
} 1"
runtimeOperations
LatencyExpected
:=
"kubelet_runtime_operations_latency_micro
seconds_count{operation_type=
\"
create_container
\"
} 1"
runtimeOperations
DurationExpected
:=
"kubelet_runtime_operations_duration_
seconds_count{operation_type=
\"
create_container
\"
} 1"
assert
.
HTTPBodyContains
(
t
,
http
.
HandlerFunc
(
func
(
w
http
.
ResponseWriter
,
r
*
http
.
Request
)
{
assert
.
HTTPBodyContains
(
t
,
http
.
HandlerFunc
(
func
(
w
http
.
ResponseWriter
,
r
*
http
.
Request
)
{
mux
.
ServeHTTP
(
w
,
r
)
mux
.
ServeHTTP
(
w
,
r
)
...
@@ -59,7 +59,7 @@ func TestRecordOperation(t *testing.T) {
...
@@ -59,7 +59,7 @@ func TestRecordOperation(t *testing.T) {
assert
.
HTTPBodyContains
(
t
,
http
.
HandlerFunc
(
func
(
w
http
.
ResponseWriter
,
r
*
http
.
Request
)
{
assert
.
HTTPBodyContains
(
t
,
http
.
HandlerFunc
(
func
(
w
http
.
ResponseWriter
,
r
*
http
.
Request
)
{
mux
.
ServeHTTP
(
w
,
r
)
mux
.
ServeHTTP
(
w
,
r
)
}),
"GET"
,
prometheusURL
,
nil
,
runtimeOperations
Latency
Expected
)
}),
"GET"
,
prometheusURL
,
nil
,
runtimeOperations
Duration
Expected
)
}
}
func
TestInstrumentedVersion
(
t
*
testing
.
T
)
{
func
TestInstrumentedVersion
(
t
*
testing
.
T
)
{
...
...
pkg/kubelet/metrics/metrics.go
View file @
0b01b9ce
This diff is collapsed.
Click to expand it.
pkg/kubelet/pleg/generic.go
View file @
0b01b9ce
...
@@ -189,12 +189,14 @@ func (g *GenericPLEG) relist() {
...
@@ -189,12 +189,14 @@ func (g *GenericPLEG) relist() {
klog
.
V
(
5
)
.
Infof
(
"GenericPLEG: Relisting"
)
klog
.
V
(
5
)
.
Infof
(
"GenericPLEG: Relisting"
)
if
lastRelistTime
:=
g
.
getRelistTime
();
!
lastRelistTime
.
IsZero
()
{
if
lastRelistTime
:=
g
.
getRelistTime
();
!
lastRelistTime
.
IsZero
()
{
metrics
.
PLEGRelistInterval
.
Observe
(
metrics
.
SinceInMicroseconds
(
lastRelistTime
))
metrics
.
PLEGRelistInterval
.
Observe
(
metrics
.
SinceInSeconds
(
lastRelistTime
))
metrics
.
DeprecatedPLEGRelistInterval
.
Observe
(
metrics
.
SinceInMicroseconds
(
lastRelistTime
))
}
}
timestamp
:=
g
.
clock
.
Now
()
timestamp
:=
g
.
clock
.
Now
()
defer
func
()
{
defer
func
()
{
metrics
.
PLEGRelistLatency
.
Observe
(
metrics
.
SinceInMicroseconds
(
timestamp
))
metrics
.
PLEGRelistDuration
.
Observe
(
metrics
.
SinceInSeconds
(
timestamp
))
metrics
.
DeprecatedPLEGRelistLatency
.
Observe
(
metrics
.
SinceInMicroseconds
(
timestamp
))
}()
}()
// Get all the pods.
// Get all the pods.
...
...
test/e2e/framework/kubelet_stats.go
View file @
0b01b9ce
...
@@ -102,13 +102,13 @@ func getKubeletMetrics(c clientset.Interface, nodeName string) (metrics.KubeletM
...
@@ -102,13 +102,13 @@ func getKubeletMetrics(c clientset.Interface, nodeName string) (metrics.KubeletM
// Note that the KubeletMetrics passed in should not contain subsystem prefix.
// Note that the KubeletMetrics passed in should not contain subsystem prefix.
func
GetDefaultKubeletLatencyMetrics
(
ms
metrics
.
KubeletMetrics
)
KubeletLatencyMetrics
{
func
GetDefaultKubeletLatencyMetrics
(
ms
metrics
.
KubeletMetrics
)
KubeletLatencyMetrics
{
latencyMetricNames
:=
sets
.
NewString
(
latencyMetricNames
:=
sets
.
NewString
(
kubeletmetrics
.
PodWorker
Latency
Key
,
kubeletmetrics
.
PodWorker
Duration
Key
,
kubeletmetrics
.
PodWorkerStart
Latency
Key
,
kubeletmetrics
.
PodWorkerStart
Duration
Key
,
kubeletmetrics
.
PodStart
Latency
Key
,
kubeletmetrics
.
PodStart
Duration
Key
,
kubeletmetrics
.
CgroupManagerOperationsKey
,
kubeletmetrics
.
CgroupManagerOperationsKey
,
dockermetrics
.
DockerOperationsLatencyKey
,
dockermetrics
.
DockerOperationsLatencyKey
,
kubeletmetrics
.
PodWorkerStart
Latency
Key
,
kubeletmetrics
.
PodWorkerStart
Duration
Key
,
kubeletmetrics
.
PLEGRelist
Latency
Key
,
kubeletmetrics
.
PLEGRelist
Duration
Key
,
)
)
return
GetKubeletLatencyMetrics
(
ms
,
latencyMetricNames
)
return
GetKubeletLatencyMetrics
(
ms
,
latencyMetricNames
)
}
}
...
...
test/e2e/framework/metrics_util.go
View file @
0b01b9ce
...
@@ -168,9 +168,9 @@ var InterestingKubeletMetrics = []string{
...
@@ -168,9 +168,9 @@ var InterestingKubeletMetrics = []string{
"kubelet_docker_errors"
,
"kubelet_docker_errors"
,
"kubelet_docker_operations_latency_seconds"
,
"kubelet_docker_operations_latency_seconds"
,
"kubelet_generate_pod_status_latency_microseconds"
,
"kubelet_generate_pod_status_latency_microseconds"
,
"kubelet_pod_start_
latency_micro
seconds"
,
"kubelet_pod_start_
duration_
seconds"
,
"kubelet_pod_worker_
latency_micro
seconds"
,
"kubelet_pod_worker_
duration_
seconds"
,
"kubelet_pod_worker_start_
latency_micro
seconds"
,
"kubelet_pod_worker_start_
duration_
seconds"
,
"kubelet_sync_pods_latency_microseconds"
,
"kubelet_sync_pods_latency_microseconds"
,
}
}
...
...
test/e2e_node/density_test.go
View file @
0b01b9ce
...
@@ -459,12 +459,12 @@ func getPodStartLatency(node string) (framework.KubeletLatencyMetrics, error) {
...
@@ -459,12 +459,12 @@ func getPodStartLatency(node string) (framework.KubeletLatencyMetrics, error) {
for
_
,
samples
:=
range
ms
{
for
_
,
samples
:=
range
ms
{
for
_
,
sample
:=
range
samples
{
for
_
,
sample
:=
range
samples
{
if
sample
.
Metric
[
"__name__"
]
==
kubemetrics
.
KubeletSubsystem
+
"_"
+
kubemetrics
.
PodStart
Latency
Key
{
if
sample
.
Metric
[
"__name__"
]
==
kubemetrics
.
KubeletSubsystem
+
"_"
+
kubemetrics
.
PodStart
Duration
Key
{
quantile
,
_
:=
strconv
.
ParseFloat
(
string
(
sample
.
Metric
[
"quantile"
]),
64
)
quantile
,
_
:=
strconv
.
ParseFloat
(
string
(
sample
.
Metric
[
"quantile"
]),
64
)
latencyMetrics
=
append
(
latencyMetrics
,
latencyMetrics
=
append
(
latencyMetrics
,
framework
.
KubeletLatencyMetric
{
framework
.
KubeletLatencyMetric
{
Quantile
:
quantile
,
Quantile
:
quantile
,
Method
:
kubemetrics
.
PodStart
Latency
Key
,
Method
:
kubemetrics
.
PodStart
Duration
Key
,
Latency
:
time
.
Duration
(
int
(
sample
.
Value
))
*
time
.
Microsecond
})
Latency
:
time
.
Duration
(
int
(
sample
.
Value
))
*
time
.
Microsecond
})
}
}
}
}
...
...
test/e2e_node/gpu_device_plugin.go
View file @
0b01b9ce
...
@@ -156,7 +156,7 @@ func logDevicePluginMetrics() {
...
@@ -156,7 +156,7 @@ func logDevicePluginMetrics() {
framework
.
ExpectNoError
(
err
)
framework
.
ExpectNoError
(
err
)
for
msKey
,
samples
:=
range
ms
{
for
msKey
,
samples
:=
range
ms
{
switch
msKey
{
switch
msKey
{
case
kubeletmetrics
.
KubeletSubsystem
+
"_"
+
kubeletmetrics
.
DevicePluginAllocation
Latency
Key
:
case
kubeletmetrics
.
KubeletSubsystem
+
"_"
+
kubeletmetrics
.
DevicePluginAllocation
Duration
Key
:
for
_
,
sample
:=
range
samples
{
for
_
,
sample
:=
range
samples
{
latency
:=
sample
.
Value
latency
:=
sample
.
Value
resource
:=
string
(
sample
.
Metric
[
"resource_name"
])
resource
:=
string
(
sample
.
Metric
[
"resource_name"
])
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment