98 Commits (v3.22.1)

Author SHA1 Message Date
Ville Skyttä 1e56c6f421 Spelling and grammar fixes
shirou b4808b3e94
Merge pull request #1204 from YangKeao/fix-unstable-boottime
fix unstable boot time because of float conversion
shirou 2f8da0a394
Merge pull request #1205 from mmorel-35/master
enable more linters, report coverage and cache mods
Makazeu 521fafd945
Fix a typo in comment
Matthieu MOREL 851bffc0f1
enable gosec linter
mmorel-35 1e6b445a8a gofumpt
shirou 69ea4bfdae
Merge pull request #1194 from mmorel-35/master
Enable errorlint and gci linters
YangKeao 1b5757b7d1 fix unstable boot time because of float conversion
Signed-off-by: YangKeao <yangkeao@chunibyo.icu>
wyl 5a288fb852 Fix bug for func named ReadLinesOffsetN
Matthieu MOREL b673968d5d
enable errorlint linter
shirou d2e27c1712 fix dependabot v2 deletion.
shirou 0969c9436b delete v2 directory, move v3 to top #1078
shirou 0fdf65fa3e Change to use yusufpapurcu/wmi from StackExchange/wmi.
shirou 0ce33dbe64
Merge pull request #1166 from easyops-cn/kestrel/process
feat(process): implement the 'OpenFilesWithContext' function of the windows system
kestrel 3dabe50107 feat(process): implement the 'OpenFilesWithContext' function of the windows system
Ville Skyttä a21240a319 Simplify some if blocks
Ville Skyttä fb0c322260 Check error identity with errors.Is
Ville Skyttä 633e77013f Use short if
Ville Skyttä ce9d35436e Merge variable declaration with assignment
Ville Skyttä 5d0724f42f Comment convention fixes
Ville Skyttä 65616500e8 Remove unnecessary empty lines
Ville Skyttä a9b1ce2dec Remove unnecessary conversions
Ville Skyttä 7743265113 Rewrite if-else chains as switches
shirou 2fa855f295 add MockEnv as more generic function.
Johannes Drummer 76fb312c4b delete unused PdhAddCounterW
Johannes Drummer 82b235c9f5 v2 windows counters on non english systems
AtakanColak 498a39984d tidy comments
AtakanColak 2c98f69e11 add load v2
tidied up common/windows
added load benchmark for load_test
cpu percent is used as load if queue is zero
AtakanColak 24e6d6d350 add load to windows
Atakan 3504ea07b0 simplify virt cache
shirou b94f262e7d
Merge pull request #949 from boogie-byte/vet-target
Add "vet" target to the Makefile
Sergey Vinogradov 8ff2ab3187 Add "vet" target to the Makefile
Making the "vet" target will run "go vet ./..." for each supported
GOOS.

Also, some of the warnings produced by go 1.15 vet were mitigated.
Ryan Fitzpatrick 8046134504
Fix VirtualizationWithContext() race in linux
shirou 5084874a4c
Merge pull request #942 from AtakanColak/patch-1
Cache common/common_linux.Virtualization()
Ata ba243b1d14
removed explicit set to nil
Ata 5fd5d64304
Cache common/common_linux.Virtualization()
By assuming virtualization environment won't change during a the program's runtime, we can cache common/common_linux.Virtualization() with a simple map to reduce amount of system calls. I first mentioned this issue at https://github.com/shirou/gopsutil/pull/890#issuecomment-690211919
Lomanic e1082dabb6 [process][darwin] Fix #925 remove references to removed const unix.SYS___SYSCTL from x/sys/unix
More like a workaround, wanted to port process.getKProcWithContext() to use unix.SysctlRaw() to get rid of exec calls to ps
in the same time but didn't have time.
ninedraft baf3495197 use legacy error check in the common.TestSleep
ninedraft 34df4904f6 use cancelable sleep in cpu.PercentWithContext and process.Process.PercentWithContext
Mihir Singh 92d6df6d8f Attempted LXC guest detection from environ procfile
Lomanic c89193f22d
Merge pull request #857 from Gui13/fix_837
Do not cache boot time for linux. Fix #837
Mauro Leggieri 00957cfedc Fixed slow command line retrieval on Windows
Guillaume Bienkowski aeb3b6b1c7 Do not cache boot time for linux. Fix #837
Ilya Prudnikov 256e00319e implement proposed solution
shirou a21ed69d3a Revert "Merge pull request #763 from Iqoqo/add-android-support-for-host"
This reverts commit f58b2e3677, reversing
changes made to 84e6215770.
Ilya Guterman 11244886bb add android support for host
Kris Watts c3720007e4 Fixes issue #730
Lomanic 47323f9ad5 [process][windows] Fix #586 use win32 API in process.Exe() instead of slow WMI call
This is faster by a factor of 100.

References:
5f4287d17f/psutil/_pswindows.py (L221)
921870d540/psutil/_psutil_windows.c (L1211)
921870d540/psutil/_psutil_windows.c (L626)
Arturo Reuschenbach Puncernau eb15d06a52 trim quotes when reading from os-release
shirou 5335e3fd50
Merge pull request #685 from cmattoon/conntrack-stat
Adds ConntrackStats (/proc/net/stat/nf_conntrack)