Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!
In [1]:
import (
"github.com/shirou/gopsutil/cpu"
"github.com/shirou/gopsutil/disk"
"github.com/shirou/gopsutil/host"
"github.com/shirou/gopsutil/mem"
"github.com/shirou/gopsutil/net"
)
In [5]:
m, err := mem.VirtualMemory()
m
Out[5]:
{"total":67327832064,"available":54480842752,"used":11837104128,"usedPercent":17.581294043075633,"free":11960410112,"active":17532755968,"inactive":33589157888,"wired":0,"laundry":0,"buffers":1849094144,"cached":41681223680,"writeback":0,"dirty":364544,"writebacktmp":0,"shared":278646784,"slab":3666907136,"sreclaimable":3168919552,"sunreclaim":497987584,"pagetables":110919680,"swapcached":3112960,"commitlimit":107391385600,"committedas":30996475904,"hightotal":0,"highfree":0,"lowtotal":0,"lowfree":0,"swaptotal":73727471616,"swapfree":73406836736,"mapped":1241595904,"vmalloctotal":35184372087808,"vmallocused":149336064,"vmallocchunk":0,"hugepagestotal":0,"hugepagesfree":0,"hugepagesize":2097152}
In [8]:
m.Total
Out[8]:
67327832064
In [25]:
disk.Usage("/")
Out[25]:
{"path":"/","fstype":"","total":1895356776448,"free":1171515428864,"used":627491057664,"usedPercent":34.87986632416368,"inodesTotal":117596160,"inodesUsed":2521275,"inodesFree":115074885,"inodesUsedPercent":2.144011335064002} <nil>
In [9]:
c, err := cpu.Info()
c
Out[9]:
[{"cpu":0,"vendorId":"GenuineIntel","family":"6","model":"165","stepping":5,"physicalId":"0","coreId":"0","cores":1,"modelName":"Intel(R) Core(TM) i9-10900K CPU @ 3.70GHz","mhz":5300,"cacheSize":20480,"flags":["fpu","vme","de","pse","tsc","msr","pae","mce","cx8","apic","sep","mtrr","pge","mca","cmov","pat","pse36","clflush","dts","acpi","mmx","fxsr","sse","sse2","ss","ht","tm","pbe","syscall","nx","pdpe1gb","rdtscp","lm","constant_tsc","art","arch_perfmon","pebs","bts","rep_good","nopl","xtopology","nonstop_tsc","cpuid","aperfmperf","pni","pclmulqdq","dtes64","monitor","ds_cpl","vmx","smx","est","tm2","ssse3","sdbg","fma","cx16","xtpr","pdcm","pcid","sse4_1","sse4_2","x2apic","movbe","popcnt","tsc_deadline_timer","aes","xsave","avx","f16c","rdrand","lahf_lm","abm","3dnowprefetch","cpuid_fault","invpcid_single","ssbd","ibrs","ibpb","stibp","ibrs_enhanced","tpr_shadow","vnmi","flexpriority","ept","vpid","ept_ad","fsgsbase","tsc_adjust","bmi1","avx2","smep","bmi2","erms","invpcid","mpx","rdseed","adx","smap","clflushopt","intel_pt","xsaveopt","xsavec","xgetbv1","xsaves","dtherm","ida","arat","pln","pts","hwp","hwp_notify","hwp_act_window","hwp_epp","pku","ospke","md_clear","flush_l1d","arch_capabilities"],"microcode":"0xec"} {"cpu":1,"vendorId":"GenuineIntel","family":"6","model":"165","stepping":5,"physicalId":"0","coreId":"1","cores":1,"modelName":"Intel(R) Core(TM) i9-10900K CPU @ 3.70GHz","mhz":5300,"cacheSize":20480,"flags":["fpu","vme","de","pse","tsc","msr","pae","mce","cx8","apic","sep","mtrr","pge","mca","cmov","pat","pse36","clflush","dts","acpi","mmx","fxsr","sse","sse2","ss","ht","tm","pbe","syscall","nx","pdpe1gb","rdtscp","lm","constant_tsc","art","arch_perfmon","pebs","bts","rep_good","nopl","xtopology","nonstop_tsc","cpuid","aperfmperf","pni","pclmulqdq","dtes64","monitor","ds_cpl","vmx","smx","est","tm2","ssse3","sdbg","fma","cx16","xtpr","pdcm","pcid","sse4_1","sse4_2","x2apic","movbe","popcnt","tsc_deadline_timer","aes","xsave","avx","f16c","rdrand","lahf_lm","abm","3dnowprefetch","cpuid_fault","invpcid_single","ssbd","ibrs","ibpb","stibp","ibrs_enhanced","tpr_shadow","vnmi","flexpriority","ept","vpid","ept_ad","fsgsbase","tsc_adjust","bmi1","avx2","smep","bmi2","erms","invpcid","mpx","rdseed","adx","smap","clflushopt","intel_pt","xsaveopt","xsavec","xgetbv1","xsaves","dtherm","ida","arat","pln","pts","hwp","hwp_notify","hwp_act_window","hwp_epp","pku","ospke","md_clear","flush_l1d","arch_capabilities"],"microcode":"0xec"} {"cpu":2,"vendorId":"GenuineIntel","family":"6","model":"165","stepping":5,"physicalId":"0","coreId":"2","cores":1,"modelName":"Intel(R) Core(TM) i9-10900K CPU @ 3.70GHz","mhz":5300,"cacheSize":20480,"flags":["fpu","vme","de","pse","tsc","msr","pae","mce","cx8","apic","sep","mtrr","pge","mca","cmov","pat","pse36","clflush","dts","acpi","mmx","fxsr","sse","sse2","ss","ht","tm","pbe","syscall","nx","pdpe1gb","rdtscp","lm","constant_tsc","art","arch_perfmon","pebs","bts","rep_good","nopl","xtopology","nonstop_tsc","cpuid","aperfmperf","pni","pclmulqdq","dtes64","monitor","ds_cpl","vmx","smx","est","tm2","ssse3","sdbg","fma","cx16","xtpr","pdcm","pcid","sse4_1","sse4_2","x2apic","movbe","popcnt","tsc_deadline_timer","aes","xsave","avx","f16c","rdrand","lahf_lm","abm","3dnowprefetch","cpuid_fault","invpcid_single","ssbd","ibrs","ibpb","stibp","ibrs_enhanced","tpr_shadow","vnmi","flexpriority","ept","vpid","ept_ad","fsgsbase","tsc_adjust","bmi1","avx2","smep","bmi2","erms","invpcid","mpx","rdseed","adx","smap","clflushopt","intel_pt","xsaveopt","xsavec","xgetbv1","xsaves","dtherm","ida","arat","pln","pts","hwp","hwp_notify","hwp_act_window","hwp_epp","pku","ospke","md_clear","flush_l1d","arch_capabilities"],"microcode":"0xec"} {"cpu":3,"vendorId":"GenuineIntel","family":"6","model":"165","stepping":5,"physicalId":"0","coreId":"3","cores":1,"modelName":"Intel(R) Core(TM) i9-10900K CPU @ 3.70GHz","mhz":5300,"cacheSize":20480,"flags":["fpu","vme","de","pse","tsc","msr","pae","mce","cx8","apic","sep","mtrr","pge","mca","cmov","pat","pse36","clflush","dts","acpi","mmx","fxsr","sse","sse2","ss","ht","tm","pbe","syscall","nx","pdpe1gb","rdtscp","lm","constant_tsc","art","arch_perfmon","pebs","bts","rep_good","nopl","xtopology","nonstop_tsc","cpuid","aperfmperf","pni","pclmulqdq","dtes64","monitor","ds_cpl","vmx","smx","est","tm2","ssse3","sdbg","fma","cx16","xtpr","pdcm","pcid","sse4_1","sse4_2","x2apic","movbe","popcnt","tsc_deadline_timer","aes","xsave","avx","f16c","rdrand","lahf_lm","abm","3dnowprefetch","cpuid_fault","invpcid_single","ssbd","ibrs","ibpb","stibp","ibrs_enhanced","tpr_shadow","vnmi","flexpriority","ept","vpid","ept_ad","fsgsbase","tsc_adjust","bmi1","avx2","smep","bmi2","erms","invpcid","mpx","rdseed","adx","smap","clflushopt","intel_pt","xsaveopt","xsavec","xgetbv1","xsaves","dtherm","ida","arat","pln","pts","hwp","hwp_notify","hwp_act_window","hwp_epp","pku","ospke","md_clear","flush_l1d","arch_capabilities"],"microcode":"0xec"} {"cpu":4,"vendorId":"GenuineIntel","family":"6","model":"165","stepping":5,"physicalId":"0","coreId":"4","cores":1,"modelName":"Intel(R) Core(TM) i9-10900K CPU @ 3.70GHz","mhz":5300,"cacheSize":20480,"flags":["fpu","vme","de","pse","tsc","msr","pae","mce","cx8","apic","sep","mtrr","pge","mca","cmov","pat","pse36","clflush","dts","acpi","mmx","fxsr","sse","sse2","ss","ht","tm","pbe","syscall","nx","pdpe1gb","rdtscp","lm","constant_tsc","art","arch_perfmon","pebs","bts","rep_good","nopl","xtopology","nonstop_tsc","cpuid","aperfmperf","pni","pclmulqdq","dtes64","monitor","ds_cpl","vmx","smx","est","tm2","ssse3","sdbg","fma","cx16","xtpr","pdcm","pcid","sse4_1","sse4_2","x2apic","movbe","popcnt","tsc_deadline_timer","aes","xsave","avx","f16c","rdrand","lahf_lm","abm","3dnowprefetch","cpuid_fault","invpcid_single","ssbd","ibrs","ibpb","stibp","ibrs_enhanced","tpr_shadow","vnmi","flexpriority","ept","vpid","ept_ad","fsgsbase","tsc_adjust","bmi1","avx2","smep","bmi2","erms","invpcid","mpx","rdseed","adx","smap","clflushopt","intel_pt","xsaveopt","xsavec","xgetbv1","xsaves","dtherm","ida","arat","pln","pts","hwp","hwp_notify","hwp_act_window","hwp_epp","pku","ospke","md_clear","flush_l1d","arch_capabilities"],"microcode":"0xec"} {"cpu":5,"vendorId":"GenuineIntel","family":"6","model":"165","stepping":5,"physicalId":"0","coreId":"5","cores":1,"modelName":"Intel(R) Core(TM) i9-10900K CPU @ 3.70GHz","mhz":5300,"cacheSize":20480,"flags":["fpu","vme","de","pse","tsc","msr","pae","mce","cx8","apic","sep","mtrr","pge","mca","cmov","pat","pse36","clflush","dts","acpi","mmx","fxsr","sse","sse2","ss","ht","tm","pbe","syscall","nx","pdpe1gb","rdtscp","lm","constant_tsc","art","arch_perfmon","pebs","bts","rep_good","nopl","xtopology","nonstop_tsc","cpuid","aperfmperf","pni","pclmulqdq","dtes64","monitor","ds_cpl","vmx","smx","est","tm2","ssse3","sdbg","fma","cx16","xtpr","pdcm","pcid","sse4_1","sse4_2","x2apic","movbe","popcnt","tsc_deadline_timer","aes","xsave","avx","f16c","rdrand","lahf_lm","abm","3dnowprefetch","cpuid_fault","invpcid_single","ssbd","ibrs","ibpb","stibp","ibrs_enhanced","tpr_shadow","vnmi","flexpriority","ept","vpid","ept_ad","fsgsbase","tsc_adjust","bmi1","avx2","smep","bmi2","erms","invpcid","mpx","rdseed","adx","smap","clflushopt","intel_pt","xsaveopt","xsavec","xgetbv1","xsaves","dtherm","ida","arat","pln","pts","hwp","hwp_notify","hwp_act_window","hwp_epp","pku","ospke","md_clear","flush_l1d","arch_capabilities"],"microcode":"0xec"} {"cpu":6,"vendorId":"GenuineIntel","family":"6","model":"165","stepping":5,"physicalId":"0","coreId":"6","cores":1,"modelName":"Intel(R) Core(TM) i9-10900K CPU @ 3.70GHz","mhz":5300,"cacheSize":20480,"flags":["fpu","vme","de","pse","tsc","msr","pae","mce","cx8","apic","sep","mtrr","pge","mca","cmov","pat","pse36","clflush","dts","acpi","mmx","fxsr","sse","sse2","ss","ht","tm","pbe","syscall","nx","pdpe1gb","rdtscp","lm","constant_tsc","art","arch_perfmon","pebs","bts","rep_good","nopl","xtopology","nonstop_tsc","cpuid","aperfmperf","pni","pclmulqdq","dtes64","monitor","ds_cpl","vmx","smx","est","tm2","ssse3","sdbg","fma","cx16","xtpr","pdcm","pcid","sse4_1","sse4_2","x2apic","movbe","popcnt","tsc_deadline_timer","aes","xsave","avx","f16c","rdrand","lahf_lm","abm","3dnowprefetch","cpuid_fault","invpcid_single","ssbd","ibrs","ibpb","stibp","ibrs_enhanced","tpr_shadow","vnmi","flexpriority","ept","vpid","ept_ad","fsgsbase","tsc_adjust","bmi1","avx2","smep","bmi2","erms","invpcid","mpx","rdseed","adx","smap","clflushopt","intel_pt","xsaveopt","xsavec","xgetbv1","xsaves","dtherm","ida","arat","pln","pts","hwp","hwp_notify","hwp_act_window","hwp_epp","pku","ospke","md_clear","flush_l1d","arch_capabilities"],"microcode":"0xec"} {"cpu":7,"vendorId":"GenuineIntel","family":"6","model":"165","stepping":5,"physicalId":"0","coreId":"7","cores":1,"modelName":"Intel(R) Core(TM) i9-10900K CPU @ 3.70GHz","mhz":5300,"cacheSize":20480,"flags":["fpu","vme","de","pse","tsc","msr","pae","mce","cx8","apic","sep","mtrr","pge","mca","cmov","pat","pse36","clflush","dts","acpi","mmx","fxsr","sse","sse2","ss","ht","tm","pbe","syscall","nx","pdpe1gb","rdtscp","lm","constant_tsc","art","arch_perfmon","pebs","bts","rep_good","nopl","xtopology","nonstop_tsc","cpuid","aperfmperf","pni","pclmulqdq","dtes64","monitor","ds_cpl","vmx","smx","est","tm2","ssse3","sdbg","fma","cx16","xtpr","pdcm","pcid","sse4_1","sse4_2","x2apic","movbe","popcnt","tsc_deadline_timer","aes","xsave","avx","f16c","rdrand","lahf_lm","abm","3dnowprefetch","cpuid_fault","invpcid_single","ssbd","ibrs","ibpb","stibp","ibrs_enhanced","tpr_shadow","vnmi","flexpriority","ept","vpid","ept_ad","fsgsbase","tsc_adjust","bmi1","avx2","smep","bmi2","erms","invpcid","mpx","rdseed","adx","smap","clflushopt","intel_pt","xsaveopt","xsavec","xgetbv1","xsaves","dtherm","ida","arat","pln","pts","hwp","hwp_notify","hwp_act_window","hwp_epp","pku","ospke","md_clear","flush_l1d","arch_capabilities"],"microcode":"0xec"} {"cpu":8,"vendorId":"GenuineIntel","family":"6","model":"165","stepping":5,"physicalId":"0","coreId":"8","cores":1,"modelName":"Intel(R) Core(TM) i9-10900K CPU @ 3.70GHz","mhz":5300,"cacheSize":20480,"flags":["fpu","vme","de","pse","tsc","msr","pae","mce","cx8","apic","sep","mtrr","pge","mca","cmov","pat","pse36","clflush","dts","acpi","mmx","fxsr","sse","sse2","ss","ht","tm","pbe","syscall","nx","pdpe1gb","rdtscp","lm","constant_tsc","art","arch_perfmon","pebs","bts","rep_good","nopl","xtopology","nonstop_tsc","cpuid","aperfmperf","pni","pclmulqdq","dtes64","monitor","ds_cpl","vmx","smx","est","tm2","ssse3","sdbg","fma","cx16","xtpr","pdcm","pcid","sse4_1","sse4_2","x2apic","movbe","popcnt","tsc_deadline_timer","aes","xsave","avx","f16c","rdrand","lahf_lm","abm","3dnowprefetch","cpuid_fault","invpcid_single","ssbd","ibrs","ibpb","stibp","ibrs_enhanced","tpr_shadow","vnmi","flexpriority","ept","vpid","ept_ad","fsgsbase","tsc_adjust","bmi1","avx2","smep","bmi2","erms","invpcid","mpx","rdseed","adx","smap","clflushopt","intel_pt","xsaveopt","xsavec","xgetbv1","xsaves","dtherm","ida","arat","pln","pts","hwp","hwp_notify","hwp_act_window","hwp_epp","pku","ospke","md_clear","flush_l1d","arch_capabilities"],"microcode":"0xec"} {"cpu":9,"vendorId":"GenuineIntel","family":"6","model":"165","stepping":5,"physicalId":"0","coreId":"9","cores":1,"modelName":"Intel(R) Core(TM) i9-10900K CPU @ 3.70GHz","mhz":5300,"cacheSize":20480,"flags":["fpu","vme","de","pse","tsc","msr","pae","mce","cx8","apic","sep","mtrr","pge","mca","cmov","pat","pse36","clflush","dts","acpi","mmx","fxsr","sse","sse2","ss","ht","tm","pbe","syscall","nx","pdpe1gb","rdtscp","lm","constant_tsc","art","arch_perfmon","pebs","bts","rep_good","nopl","xtopology","nonstop_tsc","cpuid","aperfmperf","pni","pclmulqdq","dtes64","monitor","ds_cpl","vmx","smx","est","tm2","ssse3","sdbg","fma","cx16","xtpr","pdcm","pcid","sse4_1","sse4_2","x2apic","movbe","popcnt","tsc_deadline_timer","aes","xsave","avx","f16c","rdrand","lahf_lm","abm","3dnowprefetch","cpuid_fault","invpcid_single","ssbd","ibrs","ibpb","stibp","ibrs_enhanced","tpr_shadow","vnmi","flexpriority","ept","vpid","ept_ad","fsgsbase","tsc_adjust","bmi1","avx2","smep","bmi2","erms","invpcid","mpx","rdseed","adx","smap","clflushopt","intel_pt","xsaveopt","xsavec","xgetbv1","xsaves","dtherm","ida","arat","pln","pts","hwp","hwp_notify","hwp_act_window","hwp_epp","pku","ospke","md_clear","flush_l1d","arch_capabilities"],"microcode":"0xec"} {"cpu":10,"vendorId":"GenuineIntel","family":"6","model":"165","stepping":5,"physicalId":"0","coreId":"0","cores":1,"modelName":"Intel(R) Core(TM) i9-10900K CPU @ 3.70GHz","mhz":5300,"cacheSize":20480,"flags":["fpu","vme","de","pse","tsc","msr","pae","mce","cx8","apic","sep","mtrr","pge","mca","cmov","pat","pse36","clflush","dts","acpi","mmx","fxsr","sse","sse2","ss","ht","tm","pbe","syscall","nx","pdpe1gb","rdtscp","lm","constant_tsc","art","arch_perfmon","pebs","bts","rep_good","nopl","xtopology","nonstop_tsc","cpuid","aperfmperf","pni","pclmulqdq","dtes64","monitor","ds_cpl","vmx","smx","est","tm2","ssse3","sdbg","fma","cx16","xtpr","pdcm","pcid","sse4_1","sse4_2","x2apic","movbe","popcnt","tsc_deadline_timer","aes","xsave","avx","f16c","rdrand","lahf_lm","abm","3dnowprefetch","cpuid_fault","invpcid_single","ssbd","ibrs","ibpb","stibp","ibrs_enhanced","tpr_shadow","vnmi","flexpriority","ept","vpid","ept_ad","fsgsbase","tsc_adjust","bmi1","avx2","smep","bmi2","erms","invpcid","mpx","rdseed","adx","smap","clflushopt","intel_pt","xsaveopt","xsavec","xgetbv1","xsaves","dtherm","ida","arat","pln","pts","hwp","hwp_notify","hwp_act_window","hwp_epp","pku","ospke","md_clear","flush_l1d","arch_capabilities"],"microcode":"0xec"} {"cpu":11,"vendorId":"GenuineIntel","family":"6","model":"165","stepping":5,"physicalId":"0","coreId":"1","cores":1,"modelName":"Intel(R) Core(TM) i9-10900K CPU @ 3.70GHz","mhz":5300,"cacheSize":20480,"flags":["fpu","vme","de","pse","tsc","msr","pae","mce","cx8","apic","sep","mtrr","pge","mca","cmov","pat","pse36","clflush","dts","acpi","mmx","fxsr","sse","sse2","ss","ht","tm","pbe","syscall","nx","pdpe1gb","rdtscp","lm","constant_tsc","art","arch_perfmon","pebs","bts","rep_good","nopl","xtopology","nonstop_tsc","cpuid","aperfmperf","pni","pclmulqdq","dtes64","monitor","ds_cpl","vmx","smx","est","tm2","ssse3","sdbg","fma","cx16","xtpr","pdcm","pcid","sse4_1","sse4_2","x2apic","movbe","popcnt","tsc_deadline_timer","aes","xsave","avx","f16c","rdrand","lahf_lm","abm","3dnowprefetch","cpuid_fault","invpcid_single","ssbd","ibrs","ibpb","stibp","ibrs_enhanced","tpr_shadow","vnmi","flexpriority","ept","vpid","ept_ad","fsgsbase","tsc_adjust","bmi1","avx2","smep","bmi2","erms","invpcid","mpx","rdseed","adx","smap","clflushopt","intel_pt","xsaveopt","xsavec","xgetbv1","xsaves","dtherm","ida","arat","pln","pts","hwp","hwp_notify","hwp_act_window","hwp_epp","pku","ospke","md_clear","flush_l1d","arch_capabilities"],"microcode":"0xec"} {"cpu":12,"vendorId":"GenuineIntel","family":"6","model":"165","stepping":5,"physicalId":"0","coreId":"2","cores":1,"modelName":"Intel(R) Core(TM) i9-10900K CPU @ 3.70GHz","mhz":5300,"cacheSize":20480,"flags":["fpu","vme","de","pse","tsc","msr","pae","mce","cx8","apic","sep","mtrr","pge","mca","cmov","pat","pse36","clflush","dts","acpi","mmx","fxsr","sse","sse2","ss","ht","tm","pbe","syscall","nx","pdpe1gb","rdtscp","lm","constant_tsc","art","arch_perfmon","pebs","bts","rep_good","nopl","xtopology","nonstop_tsc","cpuid","aperfmperf","pni","pclmulqdq","dtes64","monitor","ds_cpl","vmx","smx","est","tm2","ssse3","sdbg","fma","cx16","xtpr","pdcm","pcid","sse4_1","sse4_2","x2apic","movbe","popcnt","tsc_deadline_timer","aes","xsave","avx","f16c","rdrand","lahf_lm","abm","3dnowprefetch","cpuid_fault","invpcid_single","ssbd","ibrs","ibpb","stibp","ibrs_enhanced","tpr_shadow","vnmi","flexpriority","ept","vpid","ept_ad","fsgsbase","tsc_adjust","bmi1","avx2","smep","bmi2","erms","invpcid","mpx","rdseed","adx","smap","clflushopt","intel_pt","xsaveopt","xsavec","xgetbv1","xsaves","dtherm","ida","arat","pln","pts","hwp","hwp_notify","hwp_act_window","hwp_epp","pku","ospke","md_clear","flush_l1d","arch_capabilities"],"microcode":"0xec"} {"cpu":13,"vendorId":"GenuineIntel","family":"6","model":"165","stepping":5,"physicalId":"0","coreId":"3","cores":1,"modelName":"Intel(R) Core(TM) i9-10900K CPU @ 3.70GHz","mhz":5300,"cacheSize":20480,"flags":["fpu","vme","de","pse","tsc","msr","pae","mce","cx8","apic","sep","mtrr","pge","mca","cmov","pat","pse36","clflush","dts","acpi","mmx","fxsr","sse","sse2","ss","ht","tm","pbe","syscall","nx","pdpe1gb","rdtscp","lm","constant_tsc","art","arch_perfmon","pebs","bts","rep_good","nopl","xtopology","nonstop_tsc","cpuid","aperfmperf","pni","pclmulqdq","dtes64","monitor","ds_cpl","vmx","smx","est","tm2","ssse3","sdbg","fma","cx16","xtpr","pdcm","pcid","sse4_1","sse4_2","x2apic","movbe","popcnt","tsc_deadline_timer","aes","xsave","avx","f16c","rdrand","lahf_lm","abm","3dnowprefetch","cpuid_fault","invpcid_single","ssbd","ibrs","ibpb","stibp","ibrs_enhanced","tpr_shadow","vnmi","flexpriority","ept","vpid","ept_ad","fsgsbase","tsc_adjust","bmi1","avx2","smep","bmi2","erms","invpcid","mpx","rdseed","adx","smap","clflushopt","intel_pt","xsaveopt","xsavec","xgetbv1","xsaves","dtherm","ida","arat","pln","pts","hwp","hwp_notify","hwp_act_window","hwp_epp","pku","ospke","md_clear","flush_l1d","arch_capabilities"],"microcode":"0xec"} {"cpu":14,"vendorId":"GenuineIntel","family":"6","model":"165","stepping":5,"physicalId":"0","coreId":"4","cores":1,"modelName":"Intel(R) Core(TM) i9-10900K CPU @ 3.70GHz","mhz":5300,"cacheSize":20480,"flags":["fpu","vme","de","pse","tsc","msr","pae","mce","cx8","apic","sep","mtrr","pge","mca","cmov","pat","pse36","clflush","dts","acpi","mmx","fxsr","sse","sse2","ss","ht","tm","pbe","syscall","nx","pdpe1gb","rdtscp","lm","constant_tsc","art","arch_perfmon","pebs","bts","rep_good","nopl","xtopology","nonstop_tsc","cpuid","aperfmperf","pni","pclmulqdq","dtes64","monitor","ds_cpl","vmx","smx","est","tm2","ssse3","sdbg","fma","cx16","xtpr","pdcm","pcid","sse4_1","sse4_2","x2apic","movbe","popcnt","tsc_deadline_timer","aes","xsave","avx","f16c","rdrand","lahf_lm","abm","3dnowprefetch","cpuid_fault","invpcid_single","ssbd","ibrs","ibpb","stibp","ibrs_enhanced","tpr_shadow","vnmi","flexpriority","ept","vpid","ept_ad","fsgsbase","tsc_adjust","bmi1","avx2","smep","bmi2","erms","invpcid","mpx","rdseed","adx","smap","clflushopt","intel_pt","xsaveopt","xsavec","xgetbv1","xsaves","dtherm","ida","arat","pln","pts","hwp","hwp_notify","hwp_act_window","hwp_epp","pku","ospke","md_clear","flush_l1d","arch_capabilities"],"microcode":"0xec"} {"cpu":15,"vendorId":"GenuineIntel","family":"6","model":"165","stepping":5,"physicalId":"0","coreId":"5","cores":1,"modelName":"Intel(R) Core(TM) i9-10900K CPU @ 3.70GHz","mhz":5300,"cacheSize":20480,"flags":["fpu","vme","de","pse","tsc","msr","pae","mce","cx8","apic","sep","mtrr","pge","mca","cmov","pat","pse36","clflush","dts","acpi","mmx","fxsr","sse","sse2","ss","ht","tm","pbe","syscall","nx","pdpe1gb","rdtscp","lm","constant_tsc","art","arch_perfmon","pebs","bts","rep_good","nopl","xtopology","nonstop_tsc","cpuid","aperfmperf","pni","pclmulqdq","dtes64","monitor","ds_cpl","vmx","smx","est","tm2","ssse3","sdbg","fma","cx16","xtpr","pdcm","pcid","sse4_1","sse4_2","x2apic","movbe","popcnt","tsc_deadline_timer","aes","xsave","avx","f16c","rdrand","lahf_lm","abm","3dnowprefetch","cpuid_fault","invpcid_single","ssbd","ibrs","ibpb","stibp","ibrs_enhanced","tpr_shadow","vnmi","flexpriority","ept","vpid","ept_ad","fsgsbase","tsc_adjust","bmi1","avx2","smep","bmi2","erms","invpcid","mpx","rdseed","adx","smap","clflushopt","intel_pt","xsaveopt","xsavec","xgetbv1","xsaves","dtherm","ida","arat","pln","pts","hwp","hwp_notify","hwp_act_window","hwp_epp","pku","ospke","md_clear","flush_l1d","arch_capabilities"],"microcode":"0xec"} {"cpu":16,"vendorId":"GenuineIntel","family":"6","model":"165","stepping":5,"physicalId":"0","coreId":"6","cores":1,"modelName":"Intel(R) Core(TM) i9-10900K CPU @ 3.70GHz","mhz":5300,"cacheSize":20480,"flags":["fpu","vme","de","pse","tsc","msr","pae","mce","cx8","apic","sep","mtrr","pge","mca","cmov","pat","pse36","clflush","dts","acpi","mmx","fxsr","sse","sse2","ss","ht","tm","pbe","syscall","nx","pdpe1gb","rdtscp","lm","constant_tsc","art","arch_perfmon","pebs","bts","rep_good","nopl","xtopology","nonstop_tsc","cpuid","aperfmperf","pni","pclmulqdq","dtes64","monitor","ds_cpl","vmx","smx","est","tm2","ssse3","sdbg","fma","cx16","xtpr","pdcm","pcid","sse4_1","sse4_2","x2apic","movbe","popcnt","tsc_deadline_timer","aes","xsave","avx","f16c","rdrand","lahf_lm","abm","3dnowprefetch","cpuid_fault","invpcid_single","ssbd","ibrs","ibpb","stibp","ibrs_enhanced","tpr_shadow","vnmi","flexpriority","ept","vpid","ept_ad","fsgsbase","tsc_adjust","bmi1","avx2","smep","bmi2","erms","invpcid","mpx","rdseed","adx","smap","clflushopt","intel_pt","xsaveopt","xsavec","xgetbv1","xsaves","dtherm","ida","arat","pln","pts","hwp","hwp_notify","hwp_act_window","hwp_epp","pku","ospke","md_clear","flush_l1d","arch_capabilities"],"microcode":"0xec"} {"cpu":17,"vendorId":"GenuineIntel","family":"6","model":"165","stepping":5,"physicalId":"0","coreId":"7","cores":1,"modelName":"Intel(R) Core(TM) i9-10900K CPU @ 3.70GHz","mhz":5300,"cacheSize":20480,"flags":["fpu","vme","de","pse","tsc","msr","pae","mce","cx8","apic","sep","mtrr","pge","mca","cmov","pat","pse36","clflush","dts","acpi","mmx","fxsr","sse","sse2","ss","ht","tm","pbe","syscall","nx","pdpe1gb","rdtscp","lm","constant_tsc","art","arch_perfmon","pebs","bts","rep_good","nopl","xtopology","nonstop_tsc","cpuid","aperfmperf","pni","pclmulqdq","dtes64","monitor","ds_cpl","vmx","smx","est","tm2","ssse3","sdbg","fma","cx16","xtpr","pdcm","pcid","sse4_1","sse4_2","x2apic","movbe","popcnt","tsc_deadline_timer","aes","xsave","avx","f16c","rdrand","lahf_lm","abm","3dnowprefetch","cpuid_fault","invpcid_single","ssbd","ibrs","ibpb","stibp","ibrs_enhanced","tpr_shadow","vnmi","flexpriority","ept","vpid","ept_ad","fsgsbase","tsc_adjust","bmi1","avx2","smep","bmi2","erms","invpcid","mpx","rdseed","adx","smap","clflushopt","intel_pt","xsaveopt","xsavec","xgetbv1","xsaves","dtherm","ida","arat","pln","pts","hwp","hwp_notify","hwp_act_window","hwp_epp","pku","ospke","md_clear","flush_l1d","arch_capabilities"],"microcode":"0xec"} {"cpu":18,"vendorId":"GenuineIntel","family":"6","model":"165","stepping":5,"physicalId":"0","coreId":"8","cores":1,"modelName":"Intel(R) Core(TM) i9-10900K CPU @ 3.70GHz","mhz":5300,"cacheSize":20480,"flags":["fpu","vme","de","pse","tsc","msr","pae","mce","cx8","apic","sep","mtrr","pge","mca","cmov","pat","pse36","clflush","dts","acpi","mmx","fxsr","sse","sse2","ss","ht","tm","pbe","syscall","nx","pdpe1gb","rdtscp","lm","constant_tsc","art","arch_perfmon","pebs","bts","rep_good","nopl","xtopology","nonstop_tsc","cpuid","aperfmperf","pni","pclmulqdq","dtes64","monitor","ds_cpl","vmx","smx","est","tm2","ssse3","sdbg","fma","cx16","xtpr","pdcm","pcid","sse4_1","sse4_2","x2apic","movbe","popcnt","tsc_deadline_timer","aes","xsave","avx","f16c","rdrand","lahf_lm","abm","3dnowprefetch","cpuid_fault","invpcid_single","ssbd","ibrs","ibpb","stibp","ibrs_enhanced","tpr_shadow","vnmi","flexpriority","ept","vpid","ept_ad","fsgsbase","tsc_adjust","bmi1","avx2","smep","bmi2","erms","invpcid","mpx","rdseed","adx","smap","clflushopt","intel_pt","xsaveopt","xsavec","xgetbv1","xsaves","dtherm","ida","arat","pln","pts","hwp","hwp_notify","hwp_act_window","hwp_epp","pku","ospke","md_clear","flush_l1d","arch_capabilities"],"microcode":"0xec"} {"cpu":19,"vendorId":"GenuineIntel","family":"6","model":"165","stepping":5,"physicalId":"0","coreId":"9","cores":1,"modelName":"Intel(R) Core(TM) i9-10900K CPU @ 3.70GHz","mhz":5300,"cacheSize":20480,"flags":["fpu","vme","de","pse","tsc","msr","pae","mce","cx8","apic","sep","mtrr","pge","mca","cmov","pat","pse36","clflush","dts","acpi","mmx","fxsr","sse","sse2","ss","ht","tm","pbe","syscall","nx","pdpe1gb","rdtscp","lm","constant_tsc","art","arch_perfmon","pebs","bts","rep_good","nopl","xtopology","nonstop_tsc","cpuid","aperfmperf","pni","pclmulqdq","dtes64","monitor","ds_cpl","vmx","smx","est","tm2","ssse3","sdbg","fma","cx16","xtpr","pdcm","pcid","sse4_1","sse4_2","x2apic","movbe","popcnt","tsc_deadline_timer","aes","xsave","avx","f16c","rdrand","lahf_lm","abm","3dnowprefetch","cpuid_fault","invpcid_single","ssbd","ibrs","ibpb","stibp","ibrs_enhanced","tpr_shadow","vnmi","flexpriority","ept","vpid","ept_ad","fsgsbase","tsc_adjust","bmi1","avx2","smep","bmi2","erms","invpcid","mpx","rdseed","adx","smap","clflushopt","intel_pt","xsaveopt","xsavec","xgetbv1","xsaves","dtherm","ida","arat","pln","pts","hwp","hwp_notify","hwp_act_window","hwp_epp","pku","ospke","md_clear","flush_l1d","arch_capabilities"],"microcode":"0xec"}]
In [10]:
len(c)
Out[10]:
20
In [12]:
c[5]
Out[12]:
{"cpu":5,"vendorId":"GenuineIntel","family":"6","model":"165","stepping":5,"physicalId":"0","coreId":"5","cores":1,"modelName":"Intel(R) Core(TM) i9-10900K CPU @ 3.70GHz","mhz":5300,"cacheSize":20480,"flags":["fpu","vme","de","pse","tsc","msr","pae","mce","cx8","apic","sep","mtrr","pge","mca","cmov","pat","pse36","clflush","dts","acpi","mmx","fxsr","sse","sse2","ss","ht","tm","pbe","syscall","nx","pdpe1gb","rdtscp","lm","constant_tsc","art","arch_perfmon","pebs","bts","rep_good","nopl","xtopology","nonstop_tsc","cpuid","aperfmperf","pni","pclmulqdq","dtes64","monitor","ds_cpl","vmx","smx","est","tm2","ssse3","sdbg","fma","cx16","xtpr","pdcm","pcid","sse4_1","sse4_2","x2apic","movbe","popcnt","tsc_deadline_timer","aes","xsave","avx","f16c","rdrand","lahf_lm","abm","3dnowprefetch","cpuid_fault","invpcid_single","ssbd","ibrs","ibpb","stibp","ibrs_enhanced","tpr_shadow","vnmi","flexpriority","ept","vpid","ept_ad","fsgsbase","tsc_adjust","bmi1","avx2","smep","bmi2","erms","invpcid","mpx","rdseed","adx","smap","clflushopt","intel_pt","xsaveopt","xsavec","xgetbv1","xsaves","dtherm","ida","arat","pln","pts","hwp","hwp_notify","hwp_act_window","hwp_epp","pku","ospke","md_clear","flush_l1d","arch_capabilities"],"microcode":"0xec"}
In [27]:
cpu.Percent(0, true)
Out[27]:
[0.11413353624025302 0.41904761904983645 0.36176694591581293 0.17123287671242357 0.9889691898141973 0.3424006087142659 0.19022256040042165 0.32337835267379655 0.2663115845571302 0.20924481643354356 0.24724229744962997 2.783072817384986 6.162038798023294 0.22844089092332692 0.34246575342484714 0.22852789945165872 0.11413353623578189 0.057045065606691064 0.22826707247156378 0.3237478575559234] <nil>
In [28]:
host.Info()
Out[28]:
{"hostname":"jupyterhub-ds","uptime":2257963,"bootTime":1654809740,"procs":18,"os":"linux","platform":"ubuntu","platformFamily":"debian","platformVersion":"22.04","kernelVersion":"5.13.0-48-generic","kernelArch":"x86_64","virtualizationSystem":"docker","virtualizationRole":"guest","hostid":"545b09c8-31ff-450e-9e15-34e71b7afe86"} <nil>
In [29]:
net.Interfaces()
Out[29]:
[{"index":1,"mtu":65536,"name":"lo","hardwareaddr":"","flags":["up","loopback"],"addrs":[{"addr":"127.0.0.1/8"}]} {"index":22,"mtu":1500,"name":"eth0","hardwareaddr":"02:42:ac:11:00:04","flags":["up","broadcast","multicast"],"addrs":[{"addr":"172.17.0.4/16"}]}] <nil>
In [30]:
disk.GetDiskSerialNumber("/dev/sda")
Out[30]:
Memory Used by the Golang Application¶
In [17]:
var m runtime.MemStats
runtime.ReadMemStats(&m)
In [17]:
m.TotalAlloc
Out[17]:
8256400
In [32]:
m.Sys
Out[32]:
31540232
In [ ]: