Commit Graph

67 Commits (04c870cb3da4139228e2fd931a45a00725bdbe74)

Author SHA1 Message Date
Matthieu MOREL b673968d5d
enable errorlint linter 3 years ago
shirou d2e27c1712 fix dependabot v2 deletion. 3 years ago
shirou 0969c9436b delete v2 directory, move v3 to top #1078 3 years ago
shirou 0ce33dbe64
Merge pull request #1166 from easyops-cn/kestrel/process
feat(process): implement the 'OpenFilesWithContext' function of the windows system
3 years ago
kestrelcjx 5832fdfb9b chore(process): open file in process test case 3 years ago
Max Altgelt a4679b798b
feat: Add support for Cwd() on Windows 3 years ago
shirou 7be7e7807f [process] extend maxElapsedTime on process_test 4 years ago
Tom Barker 9248140c98 Wait for server connection to be established before checking
connections.
4 years ago
Tom Barker bc4661937d Minor cleanups motivated by staticcheck warnings. 4 years ago
Tom Barker 5ce887df8f Make sure that Test_AllProcesses_cmdLine doesn't ignore failures. 4 years ago
Tom Barker 34cdfa258b Test_Connections currently fails intermittently on Linux (and maybe
other OSs), and fails consistently if run with `go test -times=N`

On inspection, Go closes TCP connections when they go out of scope and
are garbage collected. I've re-written Test_Connections() to explicitly
close connectections once the test has finished. This has the other
benefit of closing gracefully, which means the -times argument should
work.

I've also removed the t.Skip() calls inside goroutines as they are
unsupported.
4 years ago
Max Altgelt 73fee847e6
chore: add tests
Add simple tests to verify that environment variables are read.
4 years ago
Max Altgelt b02b92e16b
feat: Add support for environment variable read
Add support (for Linux and Windows for now) for reading the
environment variables of a process, with a similar syntax to
os.Environ().
For Windows, this includes some refactoring for clean access to the
RTL_USER_PROCESS_PARAMETERS structure which points to the command
line and the environment variables.
4 years ago
John Blesener e8b2bea47f
Fix spaces on long process names for MacOS 4 years ago
Lomanic 995610e109 [process][windows] Fix Nice() test expecting Unix values 4 years ago
Lomanic eaa34817d0 [process] Add benchmarks for New(), Name() Ppid()
run only them with: go test -bench=. -run=xxx github.com/shirou/gopsutil/process
5 years ago
Lomanic 64ba9d03cd [process] Properly test Ppid() against known value 5 years ago
Lomanic 1b3e0c6643 [linux] Fix #900, skip or fix failing tests in docker
TestGetProcInodesAll: create a server so there are some opened inodes
TestUsers: skip if Users is empty, because of an empty /var/run/utmp
Test_Process_Groups: skip if Groups is empty
TestConnectionsMax: skip on CI, not only CircleCI
5 years ago
shirou 7e94bb8bcd
Merge pull request #775 from TakayukiBGoto/add_additional_gids_support
[Process] Implement Groups() to get additional gids.
5 years ago
Mauro Leggieri 00957cfedc Fixed slow command line retrieval on Windows 5 years ago
Lomanic e7090ba9fc [process] Fix Test_Children test regression because of some other running test 5 years ago
Lomanic 1fcea92f73 [process] Skip if not implemented Test_IsRunning (for openbsd) 5 years ago
Lomanic e4f087a4af [process] Test process.Name() with long names #795 5 years ago
TakayukiB Goto 9c6cedb822 [Process] Fix typo 5 years ago
TakayukiB Goto f55f202e81 [Process] Implement Groups() to get additional gids. 6 years ago
Lomanic 547679f88e [process] Fix #760 implement IsRunning by checking process with same PID has same CreateTime as current process 6 years ago
Lomanic f09ba75b25 [process] Skip tests on non-implemented platforms #446 and fix Kill/Children tests on windows 6 years ago
Lomanic f49203762b [process] Fix Connections() test with goroutines listening/connecting on TCP 6 years ago
mingrammer 64a995aad4 Refactor with gofmt 6 years ago
mingrammer 017c9f9cbc Fix typos 6 years ago
shirou a33a26bd97
Merge pull request #567 from tagirb/grouped_memorymaps
implement grouped memorymaps output
6 years ago
Iskander Sharipov f3d4342c30 cpu,process: remove commented-out code
Found using https://go-critic.github.io/overview#commentedOutCode-ref
7 years ago
Tagir Bakirov 29b3c3719b fix slice indices 7 years ago
Tagir Bakirov 47166d6a81 implement grouped memorymaps output 7 years ago
Michal Rostecki 91ac1d66ac process: Check for error objects 7 years ago
shirou d1fb05a30b Skip some test if CircleCI. 7 years ago
WAKAYAMA shirou f5e19d7e16 [process]windows: implements process.Kill using os/exec 7 years ago
Leonid Podolny 7ee4a4c6ff Fix Threads() signature to better match python original 8 years ago
WAKAYAMA Shirou 906b00fc23 add features to README. Thank you for all of great contributors! 8 years ago
Shirou WAKAYAMA 15a7edb712 [process]linux: linux process status change to "R" not "Running" see #173 9 years ago
Shirou WAKAYAMA ea152ea901 [BREAKING CHANGE] rename functions to pass golint. ex) net.NetIOCounters -> net.IOCounters 9 years ago
Shirou WAKAYAMA 715c421b57 [process]: add OpenFiles() test. 9 years ago
Shirou WAKAYAMA 1de1357e77 [process]: add FailNow to avoid panic. 9 years ago
Chris Gilling b8c40ac83c process: add CmdlineSlice function for linux + freebsd
This allows for getting more exact information about each argument
especially if there are arguments that have spaces in them.

This was not implemented for darwin or for windows because they
both currently have not way of properly parsing the cmdline string.
Darwin parses the output of 'ps' which is already whitespace
segmented, and windows just has the cmdline string.
9 years ago
Johan Walles 3232d34b24 Add test for process.CPUTimes() 9 years ago
Johan Walles e3a7a45492 process.Username(): Correct user names on Darwin
Before this change, process.Username() returned "root" for all processes on
Darwin.
9 years ago
Shirou WAKAYAMA dd13300833 process[linux,freebsd,darwin]: implements Children using pgrep. 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
andy cf5660bfd3 process[linux]: calculate the CreateTime and then convert to microseconds 10 years ago
Shirou WAKAYAMA b3cf7354f6 process[linux, darwin]: implements Connections using lsof. 10 years ago