package
0.0.0-20221026013913-f274578981d7
Repository: https://github.com/pandaychen/goes-wrapper.git
Documentation: pkg.go.dev
# Functions
get cpu MHz : 2399.988.
[root@bf-serv-cli-test-56d6495d95-jfbm2 /]# cat /proc/stat
cpu 3467887829 7402144 670669262 65943628489 1051360 14218 253095025 0 0 0
cpu0 247812177 438929 51372570 4073750664 780116 1458 39979362 0 0 0
cpu1 235169218 434668 45947692 4094986373 10697 1639 26968916 0 0 0
cpu2 225781683 439578 43285824 4107724817 9592 1485 20862824 0 0 0
cpu3 220676697 513232 42289613 4113805579 9143 1655 18261785 0 0 0
cpu4 218076124 499334 41674599 4117533972 8491 1644 16610866 0 0 0
cpu5 215340998 487522 41179452 4120552851 8926 1738 15768888 0 0 0
cpu6 213499268 478080 40969862 4122913060 8723 1690 15081638 0 0 0
cpu7 210787169 471204 40527378 4124205430 150382 2903 15216436 0 0 0
cpu8 211982698 464440 40708345 4131111431 8645 1 10894860 0 0 0
cpu9 211332535 464665 40571501 4131870642 8526 0 10808146 0 0 0
cpu10 211359772 462076 40641212 4131862495 8403 0 10665528 0 0 0
cpu11 210828977 456705 40264459 4132867468 8112 0 10532617 0 0 0
cpu12 209268162 450942 40216814 4134700931 7863 0 10376140 0 0 0
cpu13 209149626 448272 40424134 4134634762 7823 1 10453089 0 0 0
cpu14 209033168 447126 40380819 4134762085 7891 0 10326323 0 0 0
cpu15 207789552 445363 40214984 4136345926 8021 0 10287602 0 0 0
intr 77186006610 24 114 0 0 229 0 0 0 0 0 0 0 0 0 43133294 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 69858620 0 34419764 0 329450373 161493 3882562 191001 3891312254 178012 4147213687 170135 3985072830 166723 581183279 163935 4031634070 163040 2484392448 161672 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
ctxt 1475123891404
btime 1573183603
processes 3236443852
procs_running 2
procs_blocked 0
*/.
get current process's cgroup info,eg:
in a tke pod:
[root@bf-serv-cli-test-56d6495d95-jfbm2 cgroup]# cat /proc/6/cgroup
12:oom:/
11:net_cls:/kubepods/burstable/podb60126d8-9064-11eb-836e-7a2eb63c648a/bde707e9e3043b4492f3a7d9be42b70d85c583c4792a3c3968194369163874e7
10:pids:/kubepods/burstable/podb60126d8-9064-11eb-836e-7a2eb63c648a/bde707e9e3043b4492f3a7d9be42b70d85c583c4792a3c3968194369163874e7
9:hugetlb:/kubepods/burstable/podb60126d8-9064-11eb-836e-7a2eb63c648a/bde707e9e3043b4492f3a7d9be42b70d85c583c4792a3c3968194369163874e7
8:cpuset:/kubepods/burstable/podb60126d8-9064-11eb-836e-7a2eb63c648a/bde707e9e3043b4492f3a7d9be42b70d85c583c4792a3c3968194369163874e7
7:blkio:/kubepods/burstable/podb60126d8-9064-11eb-836e-7a2eb63c648a/bde707e9e3043b4492f3a7d9be42b70d85c583c4792a3c3968194369163874e7
6:cpuacct,cpu:/kubepods/burstable/podb60126d8-9064-11eb-836e-7a2eb63c648a/bde707e9e3043b4492f3a7d9be42b70d85c583c4792a3c3968194369163874e7
5:memory:/kubepods/burstable/podb60126d8-9064-11eb-836e-7a2eb63c648a/bde707e9e3043b4492f3a7d9be42b70d85c583c4792a3c3968194369163874e7
4:freezer:/kubepods/burstable/podb60126d8-9064-11eb-836e-7a2eb63c648a/bde707e9e3043b4492f3a7d9be42b70d85c583c4792a3c3968194369163874e7
3:devices:/kubepods/burstable/podb60126d8-9064-11eb-836e-7a2eb63c648a/bde707e9e3043b4492f3a7d9be42b70d85c583c4792a3c3968194369163874e7
2:perf_event:/kubepods/burstable/podb60126d8-9064-11eb-836e-7a2eb63c648a/bde707e9e3043b4492f3a7d9be42b70d85c583c4792a3c3968194369163874e7
1:name=systemd:/kubepods/burstable/podb60126d8-9064-11eb-836e-7a2eb63c648a/bde707e9e3043b4492f3a7d9be42b70d85c583c4792a3c3968194369163874e7
----------------------
in a container:
[root@VM_0_7_centos system]# cat /proc/30368/cgroup
11:hugetlb:/system.slice/docker-1e939f40fb6a516434beab6ab3d2c91eb7f3100937a8b25d7576d0da8e05df2f.scope
10:cpuset:/system.slice/docker-1e939f40fb6a516434beab6ab3d2c91eb7f3100937a8b25d7576d0da8e05df2f.scope
9:freezer:/system.slice/docker-1e939f40fb6a516434beab6ab3d2c91eb7f3100937a8b25d7576d0da8e05df2f.scope
8:devices:/system.slice/docker-1e939f40fb6a516434beab6ab3d2c91eb7f3100937a8b25d7576d0da8e05df2f.scope
7:pids:/system.slice/docker-1e939f40fb6a516434beab6ab3d2c91eb7f3100937a8b25d7576d0da8e05df2f.scope
6:cpuacct,cpu:/system.slice/docker-1e939f40fb6a516434beab6ab3d2c91eb7f3100937a8b25d7576d0da8e05df2f.scope
5:memory:/system.slice/docker-1e939f40fb6a516434beab6ab3d2c91eb7f3100937a8b25d7576d0da8e05df2f.scope
4:net_prio,net_cls:/system.slice/docker-1e939f40fb6a516434beab6ab3d2c91eb7f3100937a8b25d7576d0da8e05df2f.scope
3:blkio:/system.slice/docker-1e939f40fb6a516434beab6ab3d2c91eb7f3100937a8b25d7576d0da8e05df2f.scope
2:perf_event:/system.slice/docker-1e939f40fb6a516434beab6ab3d2c91eb7f3100937a8b25d7576d0da8e05df2f.scope
1:name=systemd:/system.slice/docker-1e939f40fb6a516434beab6ab3d2c91eb7f3100937a8b25d7576d0da8e05df2f.scope
----------------------
normal:
[root@VM_0_7_centos system]# cat /proc/4429/cgroup
11:hugetlb:/
10:cpuset:/
9:freezer:/
8:devices:/user.slice
7:pids:/user.slice
6:cpuacct,cpu:/user.slice
5:memory:/user.slice
4:net_prio,net_cls:/
3:blkio:/user.slice
2:perf_event:/
*/.
No description provided by the author
初始化container的CPU采集结构.
# Constants
No description provided by the author
# Structs
存储当前进程的cgroup基础信息.
No description provided by the author
No description provided by the author
No description provided by the author