mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-14 18:53:35 +00:00
vendor updates
This commit is contained in:
12
vendor/k8s.io/kubernetes/pkg/kubelet/stats/helper.go
generated
vendored
12
vendor/k8s.io/kubernetes/pkg/kubelet/stats/helper.go
generated
vendored
@ -238,11 +238,17 @@ func isMemoryUnlimited(v uint64) bool {
|
||||
|
||||
// getCgroupInfo returns the information of the container with the specified
|
||||
// containerName from cadvisor.
|
||||
func getCgroupInfo(cadvisor cadvisor.Interface, containerName string) (*cadvisorapiv2.ContainerInfo, error) {
|
||||
func getCgroupInfo(cadvisor cadvisor.Interface, containerName string, updateStats bool) (*cadvisorapiv2.ContainerInfo, error) {
|
||||
var maxAge *time.Duration
|
||||
if updateStats {
|
||||
age := 0 * time.Second
|
||||
maxAge = &age
|
||||
}
|
||||
infoMap, err := cadvisor.ContainerInfoV2(containerName, cadvisorapiv2.RequestOptions{
|
||||
IdType: cadvisorapiv2.TypeName,
|
||||
Count: 2, // 2 samples are needed to compute "instantaneous" CPU
|
||||
Recursive: false,
|
||||
MaxAge: maxAge,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to get container info for %q: %v", containerName, err)
|
||||
@ -256,8 +262,8 @@ func getCgroupInfo(cadvisor cadvisor.Interface, containerName string) (*cadvisor
|
||||
|
||||
// getCgroupStats returns the latest stats of the container having the
|
||||
// specified containerName from cadvisor.
|
||||
func getCgroupStats(cadvisor cadvisor.Interface, containerName string) (*cadvisorapiv2.ContainerStats, error) {
|
||||
info, err := getCgroupInfo(cadvisor, containerName)
|
||||
func getCgroupStats(cadvisor cadvisor.Interface, containerName string, updateStats bool) (*cadvisorapiv2.ContainerStats, error) {
|
||||
info, err := getCgroupInfo(cadvisor, containerName, updateStats)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
Reference in New Issue
Block a user