Documentation ¶
Overview ¶
-------------------------------------------------------------------------
* * io.go * Read cgroup io metrics * * * Copyright (c) 2021, Alibaba Group Holding Limited * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * IDENTIFICATION * common/cgroup/io.go *-------------------------------------------------------------------------
Index ¶
- Variables
- type CPUMem
- func (cm *CPUMem) GetCpuDetail() (*CpuDetail, error)
- func (cm *CPUMem) GetCpuLimit() (uint64, error)
- func (cm *CPUMem) GetCpuStat() (uint64, uint64, uint64, error)
- func (cm *CPUMem) GetCpuUsage() (uint64, uint64, uint64, error)
- func (cm *CPUMem) GetHugePageMemory() (uint64, error)
- func (cm *CPUMem) GetKernalMemoryUsage() (uint64, error)
- func (cm *CPUMem) GetMaxUsageInBytes() (uint64, error)
- func (cm *CPUMem) GetMemoryLimit() (uint64, error)
- func (cm *CPUMem) GetMemoryStat() (*MemoryStat, error)
- func (cm *CPUMem) GetMemoryUsage() (uint64, error)
- func (cm *CPUMem) GetPerCpuUsage() ([]uint64, error)
- func (cm *CPUMem) InitCpu(path string) error
- func (cm *CPUMem) InitHugePageMemory(mmpath, mode string) error
- func (cm *CPUMem) InitMemory(path string) error
- type CpuDetail
- type DeviceUEvent
- type Io
- func (cio *Io) GetDiskIo() (uint64, uint64, uint64, uint64, string, string, error)
- func (cio *Io) GetIOLimit() (stat *IoStat, err error)
- func (cio *Io) GetIo() (stat *IoStat, err error)
- func (cio *Io) GetIoBytes() (*IoStat, error)
- func (cio *Io) GetIoServiceTime() (stat *IoStat, err error)
- func (cio *Io) GetIoWaitTime() (stat *IoStat, err error)
- func (cio *Io) Init(port int, onEcs bool) error
- func (cio *Io) InitPath(blkPath string, onEcs bool) error
- func (cio *Io) InitPathWithMp(blkPath string, onEcs bool, dataDev string, logDev string) error
- type IoStat
- type MemoryStat
Constants ¶
This section is empty.
Variables ¶
View Source
var Devices sync.Map
Functions ¶
This section is empty.
Types ¶
type CPUMem ¶
type CPUMem struct {
// contains filtered or unexported fields
}
func (*CPUMem) GetCpuDetail ¶
func (*CPUMem) GetCpuLimit ¶
* 获取CGroup CPU 规格 对于CPUshare 场景,取cfs_quota_us/cfs_peroid_us 对于CPUSet 场景,取cpuset 由于线上配置问题,可能存在同时开启cpuset 和cpushare ,此时取两者的最小值。
func (*CPUMem) GetHugePageMemory ¶
func (*CPUMem) GetKernalMemoryUsage ¶
func (*CPUMem) GetMaxUsageInBytes ¶
func (*CPUMem) GetMemoryLimit ¶
func (*CPUMem) GetMemoryStat ¶
func (cm *CPUMem) GetMemoryStat() (*MemoryStat, error)
func (*CPUMem) GetMemoryUsage ¶
func (*CPUMem) GetPerCpuUsage ¶
func (*CPUMem) InitHugePageMemory ¶
func (*CPUMem) InitMemory ¶
type DeviceUEvent ¶
type Io ¶
type Io struct {
// contains filtered or unexported fields
}
func (*Io) GetIOLimit ¶
get throttle iops limit
func (*Io) GetIoBytes ¶
GetIO return dataIo and logIo bytes count
func (*Io) GetIoServiceTime ¶
func (*Io) GetIoWaitTime ¶
type IoStat ¶
type IoStat struct { DataIo uint64 DataWIo uint64 DataRIo uint64 LogIo uint64 LogRIo uint64 LogWIo uint64 ReadIOPSLimit uint64 WriteIOPSLimit uint64 ReadBpsLimit uint64 WriteBpsLimit uint64 RWaitTime uint64 WWaitTime uint64 WaitTime uint64 RServiceTime uint64 WServiceTime uint64 ServiceTime uint64 }
type MemoryStat ¶
type MemoryStat struct { Cache uint64 Rss uint64 RssHuge uint64 MappedFile uint64 Pgpgin uint64 Pgpgout uint64 Swap uint64 Dirty uint64 WriteBack uint64 WorkingSetReFault uint64 WorkingSetActivate uint64 WorkingSetRestore uint64 InactiveAnon uint64 ActiveAnon uint64 InActiveFile uint64 ActiveFile uint64 UnEvictable uint64 }
Click to show internal directories.
Click to hide internal directories.