Documentation
¶
Index ¶
- Variables
- func GetAllPodsContainersCgroupsPath() (map[string]map[string]string, error)
- func GetAllPodsContainersStats() (map[string]map[string]*MalachiteCgroupInfo, error)
- type BlkIOCgDataV1
- type BlkIOCgDataV2
- type BlkioCg
- type BlkioCgV2
- type BpfFsData
- type BpfIoLatency
- type BpfNetData
- type CPU
- type CPUBasicInfo
- type CPUCgDataV1
- type CPUCgDataV2
- type CPUList
- type CPUSetCgDataV1
- type CPUSetCgDataV2
- type CPUStats
- type CgroupDataInner
- type CpiData
- type CpuacctCg
- type CpuacctCgV2
- type Cpus
- type CpusetCg
- type CpusetCgV2
- type DeviceIoDetails
- type DiskIo
- type DriverLatency
- type Full
- type Load
- type MalachiteCgroupInfo
- type MalachiteCgroupResponse
- type MalachiteCgroupV1Info
- type MalachiteCgroupV2Info
- type MalachiteClient
- type MalachiteSystemComputeResponse
- type MalachiteSystemDiskIoResponse
- type MalachiteSystemMemoryResponse
- type MalachiteSystemNetworkResponse
- type MemLocalEvents
- type MemStats
- type MemoryCg
- type MemoryCgDataV1
- type MemoryCgDataV2
- type MemoryCgV2
- type Mems
- type NetClsCg
- type NetClsCgData
- type NetworkCard
- type Numa
- type NumaStatsV1
- type NumaStatsV2
- type PerfEventCg
- type PerfEventData
- type Pressure
- type Some
- type SubSystemGroupsV1
- type SubSystemGroupsV2
- type SumLatency
- type System
- type SystemComputeData
- type SystemDiskIoData
- type SystemMemoryData
- type SystemNetworkData
- type SystemResourceKind
- type TCP
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultClient = New()
Functions ¶
func GetAllPodsContainersStats ¶
func GetAllPodsContainersStats() (map[string]map[string]*MalachiteCgroupInfo, error)
Types ¶
type BlkIOCgDataV1 ¶
type BlkIOCgDataV1 struct { FullPath string `json:"full_path"` UserPath string `json:"user_path"` IopsDetails map[string]DeviceIoDetails `json:"iops_details"` BpsDetails map[string]DeviceIoDetails `json:"bps_details"` IopsTotal uint64 `json:"iops_total"` BpsTotal uint64 `json:"bps_total"` BpfFsData BpfFsData `json:"bpf_fs_data"` OldBpfFsData BpfFsData `json:"old_bpf_fs_data"` }
type BlkIOCgDataV2 ¶
type BlkIOCgDataV2 struct { FullPath string `json:"full_path"` UserPath string `json:"user_path"` IoStat map[string]DeviceIoDetails `json:"io_stat"` IoMax map[string]uint64 `json:"io_max"` IoPressure Pressure `json:"io_pressure"` IoLatency map[string]uint64 `json:"io_latency"` IoWeight map[string]uint64 `json:"io_weight"` BpfFsData BpfFsData `json:"bpf_fs_data"` OldBpfFsData BpfFsData `json:"old_bpf_fs_data"` BpfIoLatency BpfIoLatency `json:"bpf_io_latency"` }
type BlkioCg ¶
type BlkioCg struct { V1 struct { BlkIOData BlkIOCgDataV1 `json:"V1"` } `json:"BlkIO"` }
type BlkioCgV2 ¶
type BlkioCgV2 struct { V2 struct { BlkIOData BlkIOCgDataV2 `json:"V2"` } `json:"BlkIO"` }
type BpfIoLatency ¶
type BpfIoLatency struct { Pcts int `json:"pcts"` SumLatency SumLatency `json:"sum_latency"` DriverLatency DriverLatency `json:"driver_latency"` }
type BpfNetData ¶
type CPUBasicInfo ¶
type CPUCgDataV1 ¶
type CPUCgDataV1 struct { FullPath string `json:"full_path"` CfsQuotaUs int64 `json:"cfs_quota_us"` CfsPeriodUs int64 `json:"cfs_period_us"` OldCPUBasicInfo CPUBasicInfo `json:"old_cpu_basic_info"` NewCPUBasicInfo CPUBasicInfo `json:"new_cpu_basic_info"` CPUUsageRatio float64 `json:"cpu_usage_ratio"` CPUUserUsageRatio float64 `json:"cpu_user_usage_ratio"` CPUSysUsageRatio float64 `json:"cpu_sys_usage_ratio"` CPUNrThrottled uint64 `json:"cpu_nr_throttled"` CPUNrPeriods uint64 `json:"cpu_nr_periods"` CPUThrottledTime uint64 `json:"cpu_throttled_time"` TaskNrIoWait uint64 `json:"task_nr_iowait"` TaskNrUninterruptible uint64 `json:"task_nr_unint"` TaskNrRunning uint64 `json:"task_nr_runnable"` Load Load `json:"load"` }
type CPUCgDataV2 ¶
type CPUCgDataV2 struct { FullPath string `json:"full_path"` CPUStats CPUStats `json:"cpu_stats"` CPUPressure Pressure `json:"cpu_pressure"` Weight int `json:"weight"` WeightNice int `json:"weight_nice"` MaxBurst int `json:"max_burst"` Max uint64 `json:"max"` //18446744073709551615(u64_max) means unlimited MaxPeriod int64 `json:"max_period"` CPUUsageRatio float64 `json:"cpu_usage_ratio"` CPUUserUsageRatio float64 `json:"cpu_user_usage_ratio"` CPUSysUsageRatio float64 `json:"cpu_sys_usage_ratio"` TaskNrIoWait uint64 `json:"task_nr_iowait"` TaskNrUninterruptible uint64 `json:"task_nr_unint"` TaskNrRunning uint64 `json:"task_nr_runnable"` Load Load `json:"load"` }
type CPUSetCgDataV1 ¶
type CPUSetCgDataV2 ¶
type CgroupDataInner ¶
type CgroupDataInner struct { MountPoint string `json:"mount_point"` UserPath string `json:"user_path"` CgroupType string `json:"cgroup_type"` SubSystemGroups json.RawMessage `json:"sub_system_groups"` }
type CpuacctCg ¶
type CpuacctCg struct { V1 struct { CPUData CPUCgDataV1 `json:"V1"` } `json:"Cpu"` }
type CpuacctCgV2 ¶
type CpuacctCgV2 struct { V2 struct { CPUData CPUCgDataV2 `json:"V2"` } `json:"Cpu"` }
type CpusetCg ¶
type CpusetCg struct { V1 struct { CPUSetData CPUSetCgDataV1 `json:"V1"` } `json:"CpuSet"` }
type CpusetCgV2 ¶
type CpusetCgV2 struct { V2 struct { CPUSetData CPUSetCgDataV2 `json:"V2"` } `json:"CpuSet"` }
type DeviceIoDetails ¶
type DriverLatency ¶
type MalachiteCgroupInfo ¶
type MalachiteCgroupInfo struct { MountPoint string `json:"mount_point"` UserPath string `json:"user_path"` CgroupType string `json:"cgroup_type"` V1 *MalachiteCgroupV1Info V2 *MalachiteCgroupV2Info }
func GetCgroupStats ¶
func GetCgroupStats(cgroupPath string) (*MalachiteCgroupInfo, error)
type MalachiteCgroupResponse ¶
type MalachiteCgroupResponse struct { Status int `json:"status"` Data CgroupDataInner `json:"data"` }
type MalachiteCgroupV1Info ¶
type MalachiteCgroupV1Info struct { Memory *MemoryCgDataV1 `json:"memory"` Blkio *BlkIOCgDataV1 `json:"blkio"` NetCls *NetClsCgData `json:"net_cls"` PerfEvent *PerfEventData `json:"perf_event"` CpuSet *CPUSetCgDataV1 `json:"cpuset"` Cpu *CPUCgDataV1 `json:"cpu"` }
type MalachiteCgroupV2Info ¶
type MalachiteCgroupV2Info struct { Memory *MemoryCgDataV2 `json:"memory"` Blkio *BlkIOCgDataV2 `json:"blkio"` NetCls *NetClsCgData `json:"net_cls"` PerfEvent *PerfEventData `json:"perf_event"` CpuSet *CPUSetCgDataV2 `json:"cpuset"` Cpu *CPUCgDataV2 `json:"cpu"` }
type MalachiteClient ¶
type MalachiteClient interface { GetCgroupStats(cgroup string) ([]byte, error) GetSystemStats(kind SystemResourceKind) ([]byte, error) }
func New ¶
func New() MalachiteClient
type MalachiteSystemComputeResponse ¶
type MalachiteSystemComputeResponse struct { Status int `json:"status"` Data SystemComputeData `json:"data"` }
type MalachiteSystemDiskIoResponse ¶
type MalachiteSystemDiskIoResponse struct { Status int `json:"status"` Data SystemDiskIoData `json:"data"` }
type MalachiteSystemMemoryResponse ¶
type MalachiteSystemMemoryResponse struct { Status int `json:"status"` Data SystemMemoryData `json:"data"` }
type MalachiteSystemNetworkResponse ¶
type MalachiteSystemNetworkResponse struct { Status int `json:"status"` Data SystemNetworkData `json:"data"` }
type MemLocalEvents ¶
type MemStats ¶
type MemStats struct { Anon uint64 `json:"anon"` File uint64 `json:"file"` KernelStack uint64 `json:"kernel_stack"` Sock uint64 `json:"sock"` Shmem uint64 `json:"shmem"` FileMapped uint64 `json:"file_mapped"` FileDirty uint64 `json:"file_dirty"` FileWriteback uint64 `json:"file_writeback"` AnonThp uint64 `json:"anon_thp"` InactiveAnon uint64 `json:"inactive_anon"` ActiveAnon uint64 `json:"active_anon"` InactiveFile uint64 `json:"inactive_file"` ActiveFile uint64 `json:"active_file"` Unevictable uint64 `json:"unevictable"` SlabReclaimable uint64 `json:"slab_reclaimable"` SlabUnreclaimable uint64 `json:"slab_unreclaimable"` Slab uint64 `json:"slab"` BgdReclaim uint64 `json:"bgd_reclaim"` WorkingsetRefault uint64 `json:"workingset_refault"` WorkingsetActivate uint64 `json:"workingset_activate"` WorkingsetNodereclaim uint64 `json:"workingset_nodereclaim"` Pgfault uint64 `json:"pgfault"` Pgmajfault uint64 `json:"pgmajfault"` Pgrefill uint64 `json:"pgrefill"` Pgscan uint64 `json:"pgscan"` Pgsteal uint64 `json:"pgsteal"` Pgactivate uint64 `json:"pgactivate"` Pgdeactivate uint64 `json:"pgdeactivate"` Pglazyfree uint64 `json:"pglazyfree"` Pglazyfreed uint64 `json:"pglazyfreed"` ThpFaultAlloc uint64 `json:"thp_fault_alloc"` ThpCollapseAlloc uint64 `json:"thp_collapse_alloc"` }
type MemoryCg ¶
type MemoryCg struct { V1 struct { MemoryV1Data MemoryCgDataV1 `json:"V1"` } `json:"Memory"` }
type MemoryCgDataV1 ¶
type MemoryCgDataV1 struct { FullPath string `json:"full_path"` MemoryLimitInBytes uint64 `json:"memory_limit_in_bytes"` MemoryUsageInBytes uint64 `json:"memory_usage_in_bytes"` KernMemoryUsageInBytes uint64 `json:"kern_memory_usage_in_bytes"` Cache uint64 `json:"cache"` Rss uint64 `json:"rss"` Shmem uint64 `json:"shmem"` Dirty uint64 `json:"dirty"` KswapdSteal uint64 `json:"kswapd_steal"` Writeback uint64 `json:"writeback"` Pgfault uint64 `json:"pgfault"` Pgmajfault uint64 `json:"pgmajfault"` Allocstall uint64 `json:"allocstall"` TotalCache uint64 `json:"total_cache"` TotalRss uint64 `json:"total_rss"` TotalShmem uint64 `json:"total_shmem"` TotalDirty uint64 `json:"total_dirty"` TotalKswapdSteal uint64 `json:"total_kswapd_steal"` TotalWriteback uint64 `json:"total_writeback"` TotalPgfault uint64 `json:"total_pgfault"` TotalPgmajfault uint64 `json:"total_pgmajfault"` TotalAllocstall uint64 `json:"total_allocstall"` WatermarkScaleFactor *uint `json:"watermark_scale_factor"` OomCnt int `json:"oom_cnt"` NumaStats []NumaStatsV1 `json:"numa_stat"` }
type MemoryCgDataV2 ¶
type MemoryCgDataV2 struct { FullPath string `json:"full_path"` UserPath string `json:"user_path"` MemStats MemStats `json:"mem_stats"` MemNumaStats map[string]NumaStatsV2 `json:"mem_numa_stats"` MemPressure Pressure `json:"mem_pressure"` MemLocalEvents MemLocalEvents `json:"mem_local_events"` Max uint64 `json:"max"` //18446744073709551615(u64_max) means unlimited High uint64 `json:"high"` //18446744073709551615(u64_max) means unlimited Low uint64 `json:"low"` Min uint64 `json:"min"` SwapMax uint64 `json:"swap_max"` //18446744073709551615(u64_max) means unlimited WatermarkScaleFactor *uint64 `json:"watermark_scale_factor"` OomCnt uint64 `json:"oom_cnt"` MemoryUsageInBytes uint64 `json:"memory_usage_in_bytes"` }
type MemoryCgV2 ¶
type MemoryCgV2 struct { V2 struct { MemoryData MemoryCgDataV2 `json:"V2"` } `json:"Memory"` }
type NetClsCg ¶
type NetClsCg struct {
NetData NetClsCgData `json:"Net"`
}
type NetClsCgData ¶
type NetClsCgData struct { FullPath string `json:"full_path"` UserPath string `json:"user_path"` BpfNetData BpfNetData `json:"bpf_net_data"` OldBpfNetData BpfNetData `json:"old_bpf_net_data"` }
type NetworkCard ¶
type NetworkCard struct { Name string `json:"name"` ReceiveBytes uint64 `json:"receive_bytes"` ReceivePackets uint64 `json:"receive_packets"` ReceiveErrs uint64 `json:"receive_errs"` ReceiveDrop uint64 `json:"receive_drop"` ReceiveFifo uint64 `json:"receive_fifo"` ReceiveFrame uint64 `json:"receive_frame"` ReceiveCompressed uint64 `json:"receive_compressed"` ReceiveMulticast uint64 `json:"receive_multicast"` TransmitBytes uint64 `json:"transmit_bytes"` TransmitPackets uint64 `json:"transmit_packets"` TransmitErrs uint64 `json:"transmit_errs"` TransmitDrop uint64 `json:"transmit_drop"` TransmitFifo uint64 `json:"transmit_fifo"` TransmitColls uint64 `json:"transmit_colls"` TransmitCarrier uint64 `json:"transmit_carrier"` TransmitCompressed uint64 `json:"transmit_compressed"` }
type Numa ¶
type Numa struct { ID int `json:"id"` Path string `json:"path"` CPUList CPUList `json:"cpu_list"` MemFree uint64 `json:"mem_free"` MemUsed uint64 `json:"mem_used"` MemTotal uint64 `json:"mem_total"` MemShmem uint64 `json:"mem_shmem"` MemAvailable uint64 `json:"mem_available"` MemFilePages uint64 `json:"mem_file_pages"` MemMaxBandwidthMB float64 `json:"mem_mx_bandwidth_mb"` MemReadBandwidthMB float64 `json:"mem_read_bandwidth_mb"` MemReadLatency float64 `json:"mem_read_latency"` MemTheoryMaxBandwidthMB float64 `json:"mem_theory_mx_bandwidth_mb"` MemWriteBandwidthMB float64 `json:"mem_write_bandwidth_mb"` MemWriteLatency float64 `json:"mem_write_latency"` }
type NumaStatsV1 ¶
type NumaStatsV1 struct { NumaName string `json:"numa_name"` Total int `json:"total"` File int `json:"file"` Anon int `json:"anon"` Unevictable int `json:"unevictable"` HierarchicalTotal int `json:"hierarchical_total"` HierarchicalFile int `json:"hierarchical_file"` HierarchicalAnon int `json:"hierarchical_anon"` HierarchicalUnevictable int `json:"hierarchical_unevictable"` }
type NumaStatsV2 ¶
type NumaStatsV2 struct { Anon uint64 `json:"anon"` File uint64 `json:"file"` KernelStack uint64 `json:"kernel_stack"` Shmem uint64 `json:"shmem"` FileMapped uint64 `json:"file_mapped"` FileDirty uint64 `json:"file_dirty"` FileWriteback uint64 `json:"file_writeback"` AnonThp uint64 `json:"anon_thp"` InactiveAnon uint64 `json:"inactive_anon"` ActiveAnon uint64 `json:"active_anon"` InactiveFile uint64 `json:"inactive_file"` ActiveFile uint64 `json:"active_file"` Unevictable uint64 `json:"unevictable"` SlabReclaimable uint64 `json:"slab_reclaimable"` SlabUnreclaimable uint64 `json:"slab_unreclaimable"` WorkingsetRefault uint64 `json:"workingset_refault"` WorkingsetActivate uint64 `json:"workingset_activate"` WorkingsetNodereclaim uint64 `json:"workingset_nodereclaim"` }
type PerfEventCg ¶
type PerfEventCg struct {
PerfEventData PerfEventData `json:"PerfEvent"`
}
type PerfEventData ¶
type PerfEventData struct { UserPath string `json:"user_path"` FullPath string `json:"full_path"` Cpi float64 `json:"cpi"` Cycles float64 `json:"cycles"` Instructions float64 `json:"instructions"` IcacheMiss float64 `json:"icache_miss"` L2CacheMiss float64 `json:"l2_cache_miss"` L3CacheMiss float64 `json:"l3_cache_miss"` PhyCoreUtilization float64 `json:"utilization"` }
type SubSystemGroupsV1 ¶
type SubSystemGroupsV2 ¶
type SubSystemGroupsV2 struct { Memory MemoryCgV2 `json:"memory"` Blkio BlkioCgV2 `json:"blkio"` NetCls NetClsCg `json:"net_cls"` PerfEvent PerfEventCg `json:"perf_event"` Cpuset CpusetCgV2 `json:"cpuset"` Cpuacct CpuacctCgV2 `json:"cpuacct"` }
type SumLatency ¶
type System ¶
type System struct { MemTotal uint64 `json:"mem_total"` MemFree uint64 `json:"mem_free"` MemUsed uint64 `json:"mem_used"` MemShm uint64 `json:"mem_shm"` MemAvailable uint64 `json:"mem_available"` MemBuffers uint64 `json:"mem_buffers"` MemPageCache uint64 `json:"mem_page_cache"` MemSlabReclaimable uint64 `json:"mem_slab_reclaimable"` MemDirtyPageCache uint64 `json:"mem_dirty_page_cache"` MemWriteBackPageCache uint64 `json:"mem_write_back_page_cache"` MemSwapTotal uint64 `json:"mem_swap_total"` MemSwapFree uint64 `json:"mem_swap_free"` MemUtil float64 `json:"mem_util"` VMWatermarkScaleFactor uint64 `json:"vm_watermark_scale_factor"` VmstatPgstealKswapd uint64 `json:"vmstat_pgsteal_kswapd"` }
type SystemComputeData ¶
func GetSystemComputeStats ¶
func GetSystemComputeStats() (*SystemComputeData, error)
type SystemDiskIoData ¶
type SystemDiskIoData struct {
DiskIo []DiskIo `json:"disk_io"`
}
func GetSystemIOStats ¶
func GetSystemIOStats() (*SystemDiskIoData, error)
type SystemMemoryData ¶
func GetSystemMemoryStats ¶
func GetSystemMemoryStats() (*SystemMemoryData, error)
type SystemNetworkData ¶
type SystemNetworkData struct { NetworkCard []NetworkCard `json:"networkcard"` TCP TCP `json:"tcp"` }
func GetSystemNetStats ¶
func GetSystemNetStats() (*SystemNetworkData, error)
type SystemResourceKind ¶
type SystemResourceKind int
const ( Compute SystemResourceKind = iota Memory IO Net )
type TCP ¶
type TCP struct { TCPDelayAcks uint64 `json:"tcp_delay_acks"` TCPListenOverflows uint64 `json:"tcp_listen_overflows"` TCPListenDrops uint64 `json:"tcp_listen_drops"` TCPAbortOnMemory uint64 `json:"tcp_abort_on_memory"` TCPReqQFullDrop uint64 `json:"tcp_req_q_full_drop"` TCPRetran float64 `json:"tcp_retran"` TCPRetransSegs uint64 `json:"tcp_retrans_segs"` TCPOldRetransSegs uint64 `json:"tcp_old_retrans_segs"` TCPOutSegs uint64 `json:"tcp_out_segs"` TCPOldOutSegs uint64 `json:"tcp_old_out_segs"` TCPCloseWait uint64 `json:"tcp_close_wait"` }
Click to show internal directories.
Click to hide internal directories.