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
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
kestrelcjx
5832fdfb9b
chore(process): open file in process test case
2021-10-29 20:20:23 +08:00
Max Altgelt
a4679b798b
feat: Add support for Cwd() on Windows
2021-10-27 09:55:26 +02:00
shirou
7be7e7807f
[process] extend maxElapsedTime on process_test
2021-09-30 07:47:05 +00:00
Tom Barker
9248140c98
Wait for server connection to be established before checking
...
connections.
2021-08-23 16:30:51 -04:00
Tom Barker
bc4661937d
Minor cleanups motivated by staticcheck warnings.
2021-08-19 10:43:06 -04:00
Tom Barker
5ce887df8f
Make sure that Test_AllProcesses_cmdLine doesn't ignore failures.
2021-08-19 10:43:06 -04:00
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.
2021-08-19 10:40:27 -04:00
Max Altgelt
73fee847e6
chore: add tests
...
Add simple tests to verify that environment variables are read.
2021-07-13 16:38:49 +02:00
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.
2021-07-13 15:11:29 +02:00
John Blesener
e8b2bea47f
Fix spaces on long process names for MacOS
2021-02-16 14:51:44 +09:00
Lomanic
995610e109
[process][windows] Fix Nice() test expecting Unix values
2020-11-08 17:13:56 +01:00
Lomanic
eaa34817d0
[process] Add benchmarks for New(), Name() Ppid()
...
run only them with: go test -bench=. -run=xxx github.com/shirou/gopsutil/process
2020-10-01 10:24:54 +02:00
Lomanic
64ba9d03cd
[process] Properly test Ppid() against known value
2020-09-29 23:58:34 +02:00
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
2020-09-02 01:06:17 +02:00
shirou
7e94bb8bcd
Merge pull request #775 from TakayukiBGoto/add_additional_gids_support
...
[Process] Implement Groups() to get additional gids.
2020-07-24 22:09:41 +09:00
Mauro Leggieri
00957cfedc
Fixed slow command line retrieval on Windows
2020-04-30 22:44:43 -03:00
Lomanic
e7090ba9fc
[process] Fix Test_Children test regression because of some other running test
2019-12-01 20:24:34 +01:00
Lomanic
1fcea92f73
[process] Skip if not implemented Test_IsRunning (for openbsd)
2019-12-01 19:31:54 +01:00
Lomanic
e4f087a4af
[process] Test process.Name() with long names #795
2019-12-01 19:31:48 +01:00
TakayukiB Goto
9c6cedb822
[Process] Fix typo
2019-10-24 18:48:28 +09:00
TakayukiB Goto
f55f202e81
[Process] Implement Groups() to get additional gids.
2019-10-07 12:59:36 +09:00
Lomanic
547679f88e
[process] Fix #760 implement IsRunning by checking process with same PID has same CreateTime as current process
2019-09-07 18:54:49 +02:00
Lomanic
f09ba75b25
[process] Skip tests on non-implemented platforms #446 and fix Kill/Children tests on windows
2019-09-05 18:48:00 +02:00
Lomanic
f49203762b
[process] Fix Connections() test with goroutines listening/connecting on TCP
2019-09-05 11:07:08 +02:00
mingrammer
64a995aad4
Refactor with gofmt
2019-03-23 21:57:24 +09:00
mingrammer
017c9f9cbc
Fix typos
2019-03-18 02:52:26 +09:00
shirou
a33a26bd97
Merge pull request #567 from tagirb/grouped_memorymaps
...
implement grouped memorymaps output
2019-01-13 17:17:11 +09:00
Iskander Sharipov
f3d4342c30
cpu,process: remove commented-out code
...
Found using https://go-critic.github.io/overview#commentedOutCode-ref
2018-09-13 23:56:24 +03:00
Tagir Bakirov
29b3c3719b
fix slice indices
2018-08-14 09:12:09 +02:00
Tagir Bakirov
47166d6a81
implement grouped memorymaps output
2018-08-08 09:37:17 +02:00
Michal Rostecki
91ac1d66ac
process: Check for error objects
2018-06-21 16:53:53 +02:00
shirou
d1fb05a30b
Skip some test if CircleCI.
2018-01-09 11:30:38 +09:00
WAKAYAMA shirou
f5e19d7e16
[process]windows: implements process.Kill using os/exec
2017-11-18 22:43:54 +09:00
Leonid Podolny
7ee4a4c6ff
Fix Threads() signature to better match python original
2017-10-04 15:38:01 -04:00
WAKAYAMA Shirou
906b00fc23
add features to README. Thank you for all of great contributors!
2017-07-26 22:42:13 +09:00
Shirou WAKAYAMA
15a7edb712
[process]linux: linux process status change to "R" not "Running" see #173
2016-03-27 21:54:02 +09:00
Shirou WAKAYAMA
ea152ea901
[BREAKING CHANGE] rename functions to pass golint. ex) net.NetIOCounters -> net.IOCounters
2016-03-22 23:09:12 +09:00
Shirou WAKAYAMA
715c421b57
[process]: add OpenFiles() test.
2016-03-04 09:42:40 +09:00
Shirou WAKAYAMA
1de1357e77
[process]: add FailNow to avoid panic.
2016-02-29 21:59:02 +09:00
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.
2016-02-27 18:01:49 -08:00
Johan Walles
3232d34b24
Add test for process.CPUTimes()
2016-02-24 04:25:41 +01:00
Johan Walles
e3a7a45492
process.Username(): Correct user names on Darwin
...
Before this change, process.Username() returned "root" for all processes on
Darwin.
2016-02-12 10:54:41 +01:00
Shirou WAKAYAMA
dd13300833
process[linux,freebsd,darwin]: implements Children using pgrep.
2015-11-24 00:04:20 +09:00
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
2015-10-18 20:40:01 -07:00
andy
cf5660bfd3
process[linux]: calculate the CreateTime and then convert to microseconds
2015-09-28 16:18:53 +01:00
Shirou WAKAYAMA
b3cf7354f6
process[linux, darwin]: implements Connections using lsof.
2015-09-18 13:36:13 +09:00