Commit Graph

34 Commits (9e6e627ec80b07c2ad9df6ffda7c4c99d79bd126)

Author SHA1 Message Date
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.
3 years ago
Matthieu MOREL b0469a470b
Merge branch 'master' into master 3 years ago
Matthieu MOREL 8ba220d241 enable contextcheck linter 3 years ago
shirou b4808b3e94
Merge pull request #1204 from YangKeao/fix-unstable-boottime
fix unstable boot time because of float conversion
3 years ago
mmorel-35 1e6b445a8a gofumpt 3 years ago
YangKeao 1b5757b7d1 fix unstable boot time because of float conversion
Signed-off-by: YangKeao <yangkeao@chunibyo.icu>
3 years ago
shirou 0969c9436b delete v2 directory, move v3 to top #1078 3 years ago
Ville Skyttä a21240a319 Simplify some if blocks 4 years ago
Ville Skyttä 5d0724f42f Comment convention fixes 4 years ago
Ville Skyttä 65616500e8 Remove unnecessary empty lines 4 years ago
Ville Skyttä a9b1ce2dec Remove unnecessary conversions 4 years ago
Ville Skyttä 7743265113 Rewrite if-else chains as switches 4 years ago
Atakan 3504ea07b0 simplify virt cache 4 years ago
Ryan Fitzpatrick 8046134504
Fix VirtualizationWithContext() race in linux 5 years ago
Ata ba243b1d14
removed explicit set to nil 5 years ago
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
5 years ago
Mihir Singh 92d6df6d8f Attempted LXC guest detection from environ procfile 5 years ago
Guillaume Bienkowski aeb3b6b1c7 Do not cache boot time for linux. Fix #837 5 years ago
shirou a21ed69d3a Revert "Merge pull request #763 from Iqoqo/add-android-support-for-host"
This reverts commit f58b2e3677, reversing
changes made to 84e6215770.
6 years ago
Ilya Guterman 11244886bb add android support for host 6 years ago
Kris Watts c3720007e4 Fixes issue #730 6 years ago
Arturo Reuschenbach Puncernau eb15d06a52 trim quotes when reading from os-release 6 years ago
shirou 07863cab0c [host]linux: add #688 diff which is removed after merging #689 6 years ago
Tyler Dixon 4e81681ab3 code review 6 years ago
Tyler Dixon a02925055c Remove cycle between process and host packages
gopsutil is a transitive dependency of another project that I am integrating
into an internal build system. We target multiple platforms and as a part
of the build system for the large internal repo, we calculate the build
graph used to determine what targets have changed and need to be build /
tested as a single DAG for all platforms.

gopsutil currently does not form a DAG if linux and any other platform are
considered at the same time. linux is the only platform where the process
package imports the host package.

To remove this cycle, the relevant methods have been moved to internal/common
with the linux build tag and are consumed the host and process packages.
6 years ago
Segflow 86c7289ccc Fix: use filename in exec.LookPath instead of full path
exec.LookPath searches for the file in the $PATH, which mean giving it an absolute path is against it's own purposes.
6 years ago
Michael Schurter 042305ee4a Remove SetEnv on all platforms 8 years ago
Michael Schurter 565f5c8c5e Alter subprocess's environment instead of the hosts
Fixes #415
8 years ago
Asato Wakisaka 16a38100b3 NumProcs() just counts files under f, so use f.Readdirnames to avoid `lstat` syscall inside f.Readdir. 8 years ago
tycho garen 22c56d292e close open files 8 years ago
Sean Chittenden 613ada987d
Add DoSysctrl() to Linux's common utilities. 9 years ago
Sean Chittenden e0b5f86113
Spell `error` like `err`. *facepalm* 9 years ago
Sean Chittenden a3f57b1314
Resolve cyclic import and create a common helper func, NumProcs() 9 years ago
Daniel Theophanes 0af895258e common: rename package common to internal/common. Add ENV helper funcs.
Package common wasn't used for public functions. Place it in an
internal directory to prevent other packages from using.

Remove the distributed references to "HOST_PROC" and "HOST_SYS"
consts and combine into a common function. This also helps so that
if a env var is defined with a trailing slash all will continue to
work as expected.

Fixes #100
10 years ago