Documentation
¶
Index ¶
- Variables
- type Connection
- func (self *Connection) Close() error
- func (self *Connection) Read(b []byte) (n int, err error)
- func (self *Connection) ReadMessage() (msg syscall.NetlinkMessage, err error)
- func (self *Connection) Write(b []byte) (n int, err error)
- func (self *Connection) WriteMessage(msg syscall.NetlinkMessage) error
- type CpuLoadReader
- type LoadStats
- type TaskStats
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // TODO(rjnagal): Verify and fix for other architectures. Endian = binary.LittleEndian )
Functions ¶
This section is empty.
Types ¶
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
func (*Connection) Close ¶
func (self *Connection) Close() error
func (*Connection) ReadMessage ¶
func (self *Connection) ReadMessage() (msg syscall.NetlinkMessage, err error)
func (*Connection) WriteMessage ¶
func (self *Connection) WriteMessage(msg syscall.NetlinkMessage) error
type CpuLoadReader ¶
type CpuLoadReader struct {
// contains filtered or unexported fields
}
func New ¶
func New() (*CpuLoadReader, error)
func (*CpuLoadReader) Close ¶
func (self *CpuLoadReader) Close()
func (*CpuLoadReader) GetCpuLoad ¶
func (self *CpuLoadReader) GetCpuLoad(path string) (LoadStats, error)
Returns instantaneous number of running tasks in a group. Caller can use historical data to calculate cpu load. path is an absolute filesystem path for a container under the CPU cgroup hierarchy. NOTE: non-hierarchical load is returned. It does not include load for subcontainers.
type LoadStats ¶
type LoadStats struct {
// Number of sleeping tasks.
NrSleeping uint64 `json:"nr_sleeping"`
// Number of running tasks.
NrRunning uint64 `json:"nr_running"`
// Number of tasks in stopped state
NrStopped uint64 `json:"nr_stopped"`
// Number of tasks in uninterruptible state
NrUinterruptible uint64 `json:"nr_uninterruptible"`
// Number of tasks waiting on IO
NrIoWait uint64 `json:"nr_io_wait"`
}
This mirrors kernel internal structure.
type TaskStats ¶
type TaskStats C.struct_taskstats
Click to show internal directories.
Click to hide internal directories.