Aman Gupta Karmani
34cc43d282
[android][host] fix Info() failure due to forbidden /proc/stat and /proc/uptime ( #1361 )
...
* [android][host] fallback to sysinfo() syscall for uptime
with Android O, /proc/{stat,uptime} both return permission denied
2022-11-19 04:17:18 +01:00
shirou
769daafb9e
Merge pull request #1347 from atoulme/windows_errors
...
Return all Windows partitions
2022-10-09 12:55:42 +09:00
Antoine Toulme
dbc0f20fe3
code review
2022-10-03 13:55:14 -07:00
shirou
16b3aac6ad
Merge pull request #1336 from johanburati/job043
...
Add hostinfo Virtualization hyperv
2022-09-30 17:33:58 +09:00
Ties de Wit
f253d81d1b
Update common.go
2022-09-01 09:18:20 +02:00
Johan Burati
e7034b47f2
Add hostinfo Virtualization hyperv
2022-08-02 16:23:43 +09:00
shirou
839e8b731f
fix(common): simplify size check
2022-07-19 12:43:41 +00:00
shirou
5610fbc5d5
fix(host,linux): Check if path exists and is nonempty before reading host files
2022-07-15 12:25:44 +00:00
shirou
80c890dc4c
fix(host,linux): when platform is detected to be 'amazon' cleanup os-release ID
2022-07-12 09:53:22 +00:00
shirou
f11e3ba120
fix(net,linux): move IsLittleEndian to internal
2022-07-04 08:41:25 +00:00
Ville Skyttä
f7e1f36418
refactor: remove unnecessary exec.LookPath calls
...
Executing the command does the lookup if needed and returns the same
error when not found, no need to do it separately.
2022-03-04 18:56:33 +02:00
Matthieu MOREL
b0469a470b
Merge branch 'master' into master
2022-02-01 19:28:26 +01:00
Ville Skyttä
1e56c6f421
Spelling and grammar fixes
2022-01-30 22:48:09 +02:00
Matthieu MOREL
8ba220d241
enable contextcheck linter
2022-01-24 09:26:50 +01:00
shirou
b4808b3e94
Merge pull request #1204 from YangKeao/fix-unstable-boottime
...
fix unstable boot time because of float conversion
2022-01-06 21:09:53 +09:00
shirou
2f8da0a394
Merge pull request #1205 from mmorel-35/master
...
enable more linters, report coverage and cache mods
2021-12-29 22:31:24 +09:00
Makazeu
521fafd945
Fix a typo in comment
2021-12-24 17:14:50 +08:00
Matthieu MOREL
851bffc0f1
enable gosec linter
2021-12-23 00:31:04 +01:00
mmorel-35
1e6b445a8a
gofumpt
2021-12-22 21:54:41 +00:00
shirou
69ea4bfdae
Merge pull request #1194 from mmorel-35/master
...
Enable errorlint and gci linters
2021-12-22 21:43:03 +09:00
YangKeao
1b5757b7d1
fix unstable boot time because of float conversion
...
Signed-off-by: YangKeao <yangkeao@chunibyo.icu>
2021-12-21 16:14:07 +08:00
wyl
5a288fb852
Fix bug for func named ReadLinesOffsetN
2021-12-20 09:07:46 +08:00
Matthieu MOREL
b673968d5d
enable errorlint linter
2021-12-04 22:29:38 +01:00
shirou
d2e27c1712
fix dependabot v2 deletion.
2021-12-01 00:12:55 +00:00
shirou
0969c9436b
delete v2 directory, move v3 to top #1078
2021-11-30 23:47:59 +00:00
shirou
0fdf65fa3e
Change to use yusufpapurcu/wmi from StackExchange/wmi.
2021-11-20 11:36:30 +00:00
shirou
0ce33dbe64
Merge pull request #1166 from easyops-cn/kestrel/process
...
feat(process): implement the 'OpenFilesWithContext' function of the windows system
2021-11-13 20:51:25 +09:00
kestrel
3dabe50107
feat(process): implement the 'OpenFilesWithContext' function of the windows system
2021-10-11 05:30:29 +08:00
Ville Skyttä
a21240a319
Simplify some if blocks
2021-08-18 17:09:11 +03:00
Ville Skyttä
fb0c322260
Check error identity with errors.Is
2021-08-18 17:09:11 +03:00
Ville Skyttä
633e77013f
Use short if
2021-08-18 17:09:11 +03:00
Ville Skyttä
ce9d35436e
Merge variable declaration with assignment
2021-08-18 17:09:11 +03:00
Ville Skyttä
5d0724f42f
Comment convention fixes
2021-08-18 17:09:03 +03:00
Ville Skyttä
65616500e8
Remove unnecessary empty lines
2021-08-18 16:42:17 +03:00
Ville Skyttä
a9b1ce2dec
Remove unnecessary conversions
2021-08-18 16:42:11 +03:00
Ville Skyttä
7743265113
Rewrite if-else chains as switches
2021-08-18 16:37:51 +03:00
shirou
2fa855f295
add MockEnv as more generic function.
2021-05-08 21:18:46 +09:00
Johannes Drummer
76fb312c4b
delete unused PdhAddCounterW
2021-02-06 13:11:41 +01:00
Johannes Drummer
82b235c9f5
v2 windows counters on non english systems
2021-02-06 11:01:29 +01:00
AtakanColak
498a39984d
tidy comments
2020-11-06 11:07:02 +03:00
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
2020-11-02 16:54:39 +03:00
AtakanColak
24e6d6d350
add load to windows
2020-10-22 17:44:11 +03:00
Atakan
3504ea07b0
simplify virt cache
2020-10-13 11:06:20 +03:00
shirou
b94f262e7d
Merge pull request #949 from boogie-byte/vet-target
...
Add "vet" target to the Makefile
2020-10-11 23:01:10 +09:00
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.
2020-10-10 16:50:49 +03:00
Ryan Fitzpatrick
8046134504
Fix VirtualizationWithContext() race in linux
2020-10-06 17:03:49 +00:00
shirou
5084874a4c
Merge pull request #942 from AtakanColak/patch-1
...
Cache common/common_linux.Virtualization()
2020-10-01 11:56:51 +09:00
Ata
ba243b1d14
removed explicit set to nil
2020-09-29 10:12:48 +03:00
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
2020-09-11 10:41:01 +03:00
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.
2020-09-08 11:44:46 +02:00