Documentation
¶
Index ¶
Constants ¶
View Source
const ( // TODO: it seems it is always the case for x86, sysconf(_SC_CLK_TCK) would have the right value // TODO: should we / CPUUserHz like we did in xephon-k collector CPUUserHz = 100 )
TODO: /proc/stat has more than just cpu TODO: cadvisor change log says uint64 could overflow in version 0.23.4
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlockDevice ¶
type BlockDevice struct {
// /dev/block/major:minor
Major uint64
Minor uint64
Name string
// Field 1 - 11
ReadsCompleted uint64
// Reads and writes which are adjacent to each other may be merged for
// efficiency. Thus two 4K reads may become one 8K read before it is
// ultimately handed to the disk, and so it will be counted (and queued)
// as only one I/O. This field lets you know how often this was done
ReadsMerged uint64
SectorsRead uint64 // TODO: sector size?
TimeSpentReadingMs uint64
WritesCompleted uint64
WritesMerged uint64
SectorsWritten uint64 // TODO: same as read
TimeSpentWritingMs uint64
// Field 9: The only field that should go to zero. Incremented as requests are given to appropriate struct request_queue and decremented as they finish
IoInProgress uint64
// Field 10: This field increases so long as field 9 is nonzero
TimeSpentIoMs uint64
WeightedTimeSpentIoMs uint64
}
type BlockDevices ¶
type BlockDevices struct {
Devices []BlockDevice
// contains filtered or unexported fields
}
func NewBlockDevices ¶
func NewBlockDevices(path string) *BlockDevices
func (*BlockDevices) IsStatic ¶
func (s *BlockDevices) IsStatic() bool
func (*BlockDevices) Path ¶
func (s *BlockDevices) Path() string
func (*BlockDevices) Update ¶
func (s *BlockDevices) Update() error
Update simply open the file and call UpdateFrom, they are generated by gommon from go template
func (*BlockDevices) UpdateFrom ¶
func (s *BlockDevices) UpdateFrom(r io.Reader) error
type Cpus ¶
type Filesystem ¶
type Filesystem struct {
Type int64
// Optimal transfer block size
BlockSize uint64
// Total data blocks in filesystem
Blocks uint64
// Free blocks in filesystem
BlocksFree uint64
// Free blocks available to unprivileged user
BlocksAvail uint64
// Total file nodes in filesystem
Files uint64
// Free file nodes in filesystem
FilesFree uint64
// contains filtered or unexported fields
}
func NewFilesystem ¶
func NewFilesystem(path string) *Filesystem
func (*Filesystem) IsStatic ¶
func (s *Filesystem) IsStatic() bool
func (*Filesystem) Path ¶
func (s *Filesystem) Path() string
func (*Filesystem) Update ¶
func (s *Filesystem) Update() error
func (*Filesystem) UpdateFrom ¶
func (s *Filesystem) UpdateFrom(_ io.Reader) error
type Machine ¶
type Machine struct {
NumCores int
MemTotal uint64 // KB
MemFree uint64
MemAvail uint64 // NOTE: MemAvail = MemFree + Cache + Buffer
DiskSpaceTotal uint64 // B
DiskSpaceFree uint64
DiskInodeTotal uint64
DiskInodeFree uint64
HostName string
BootTime uint64
// contains filtered or unexported fields
}
TODO: release information from lsb-release and os-release, saw it in gopsutil TODO: Machine contains information about physical node or vm, it won't change unless there are external forces
func NewMachine ¶
func NewMachine() *Machine
type Mem ¶
type Mem struct {
MemTotal uint64
MemFree uint64
MemAvailable uint64
Buffers uint64
Cached uint64
Active uint64
Inactive uint64
Dirty uint64
Writeback uint64 // Memory which is actively being written back to the disk
Mapped uint64 // Files which have been mapped into memory (with mmap(2)), such as librarie
Shmem uint64 // Amount of memory consumed in tmpfs(5) filesystems
Slab uint64 // In-kernel data structures cache
SReclaimable uint64
SUnreclaim uint64
KernelStack uint64 // Amount of memory allocated to kernel stacks
PageTables uint64
WritebackTmp uint64 // Memory used by FUSE for temporary writeback buffers
HugePagesize uint64
DirectMap4k uint64
DirectMap2M uint64
DirectMap1G uint64
SwapCached uint64
SwapTotal uint64
SwapFree uint64
// contains filtered or unexported fields
}
TODO: the code for reading mem should be generated, also we can add descriptions
Click to show internal directories.
Click to hide internal directories.