1
0
mirror of https://github.com/shirou/gopsutil.git synced 2025-05-10 19:29:14 +08:00

1337 Commits

Author SHA1 Message Date
Lomanic
946c9ce6ea [cpu] Fix #599 cap percent values returned by Percent() between 0 and 100
See https://github.com/shirou/gopsutil/issues/599#issuecomment-491942842 for a repoduction case
2019-06-23 16:14:27 +02:00
Lomanic
2ac72f1fa1 [process][linux] Fix NewProcess() on Linux
Related to #704.
Don't break previous API where a Process is always returned, fix undefined variable p.
2019-06-23 15:52:01 +02:00
Lomanic
99169acbd8
Merge pull request #704 from josedh/master
preventing file open and bad defer close call
2019-06-23 15:50:08 +02:00
Jose De La O
258343806a Preventing file open and bad defer close. Allocating mem as late as
possible
2019-06-21 17:26:52 -04:00
shirou
13375e2f9c
Merge pull request #705 from Lomanic/issue586
[process][windows] Fix #586 use win32 API in process.Exe() instead of slow WMI call
2019-06-18 08:05:37 +09:00
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)
2019-06-16 23:03:27 +02:00
Lomanic
35f21af98a
Merge pull request #699 from harpchad/solaris_cpu
Add support fo Solaris cpu times (idle, sys, user, iowait) in cpu_solaris
2019-06-08 19:53:38 +02:00
Chad Harp
8c6072d111 Cast bytes to string 2019-06-07 07:39:57 -05:00
shirou
a83baef6e4
Merge pull request #698 from picatz/fix-platformFamily-on-macOS
Update host_darwin.go
2019-06-04 23:58:34 +09:00
Lomanic
658804ae70
Merge pull request #697 from Lomanic/issue693
[net][windows] Fix #693 use MIB_IF_ROW2/GetIfEntry2 to get real uint64 values from win32 API
2019-06-03 19:43:32 +02:00
Lomanic
c4e08a3559
Merge pull request #700 from ArtieReus/sles15-quotes
trim quotes when reading from os-release
2019-06-03 14:41:26 +02:00
Arturo Reuschenbach Puncernau
eb15d06a52 trim quotes when reading from os-release 2019-06-03 14:21:04 +02:00
Chad Harp
16b37cc9c2 Modify cpu_solaris to support Sorlais 10 2019-06-02 09:58:35 -05:00
Chad Harp
354718bdd8 Add support for Solaris CPU times 2019-06-01 15:05:46 -05:00
shirou
5335e3fd50
Merge pull request #685 from cmattoon/conntrack-stat
Adds ConntrackStats (/proc/net/stat/nf_conntrack)
v2.19.05
2019-06-01 11:50:09 +09:00
shirou
07863cab0c [host]linux: add #688 diff which is removed after merging #689 2019-06-01 11:31:00 +09:00
shirou
b2cbc26504
Merge pull request #689 from ZymoticB/td-remove-cycle
Remove cycle between process and host packages
2019-06-01 11:27:28 +09:00
shirou
7c2ac48f84
Merge branch 'master' into td-remove-cycle 2019-06-01 11:26:59 +09:00
shirou
3d9d5e60ef
Merge pull request #688 from asnowfox/master
use /proc/buc/pci/devices to identify a VM is a guest
2019-06-01 11:18:40 +09:00
shirou
d8686bcd5c
Merge pull request #675 from marcv81/fix_665_v2
Fix for #665
2019-06-01 10:28:14 +09:00
shirou
4b629897d2
Merge pull request #647 from omar-polo/master
[OpenBSD][CPU] fix per-cpu
2019-06-01 10:24:59 +09:00
Kent 'picat' Gruber
e507f44421 Update host_darwin.go
Copy+pasta got me again! 🍝

No new variable on the left of `:=` 😂
2019-05-31 13:19:04 -04:00
Kent 'picat' Gruber
d13ba02ef0 Update host_darwin.go
The /System/Library/CoreServices/ServerVersion.plist exists on macOS servers , but not on a workstation such as my laptop. The actual terminoly is mostly borrowed from the windows equivalent as @Lomanic suggested. In theory, this should make interpreting the results from the two platforms a bit more consistent.

Note: The macOS server application can be installed on almost any macOS workstation to make it a server that can manage other apple devices.
2019-05-31 13:13:06 -04:00
Lomanic
3af6e1ffe7 [host][linux] Properly handle double quotes in /etc/os-release in PlatformInformation 2019-05-31 18:04:45 +02:00
Lomanic
a0019d431c
Merge pull request #691 from ArtieReus/sles15
added sles to the suse platform family
2019-05-31 17:49:00 +02:00
Lomanic
3fb9243fc2 [net][windows] Fix #693 use MIB_IF_ROW2/GetIfEntry2 to get real uint64 values from win32 API 2019-05-31 17:39:23 +02:00
Tyler Dixon
4e81681ab3 code review 2019-05-24 09:48:27 -07:00
Arturo Reuschenbach Puncernau
2a0b67d19c added sles to the suse platform family 2019-05-24 11:33:07 +02:00
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.
2019-05-22 17:45:50 -07:00
litong
6dfd8d56bb Merge branch 'master' of https://github.com/asnowfox/gopsutil 2019-05-22 11:02:14 +08:00
litong
119f26c1df use bus/pci/devices to identify a vm guest 2019-05-22 11:01:09 +08:00
Snow Fox
0cad0faa11
Merge pull request #1 from shirou/master
merge master
2019-05-22 10:46:50 +08:00
shirou
e146c2e08a
Merge pull request #677 from shirou/feature/remove_stolen_from_cpu
[cpu]: remove unused field Stolen
2019-05-12 18:43:21 +09:00
shirou
3e23fdab39
Merge pull request #684 from Lomanic/issue670
[process][darwin] Fix #670 remove call to common.Pipeline (prone to race condition)
2019-05-12 18:15:54 +09:00
Curtis Mattoon
648bf4eebc Adds ConntrackStats to get conntrack summary stats 2019-05-11 12:45:05 -04:00
Lomanic
0e0dd767df [process][darwin] Fix #670 remove call to common.Pipeline (prone to race condition)
Also properly parse lsof to get second txt record instead of hoping the 5th line is the right one (wrong data returned for pid 57)
2019-05-08 18:17:56 +02:00
shirou
1b7d8ed295
Merge pull request #683 from Segflow/master
Fix: use filename in exec.LookPath instead of full path
2019-05-06 08:34:57 +09:00
litong
12005ab922 use /proc/bus/pci/devices to idenetify a kvm guest 2019-05-06 07:18:49 +08:00
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.
2019-05-05 20:45:07 +01:00
shirou
01487156ff
Merge pull request #682 from pytimer/add-load-procstotal
add ProcsTotal in load
2019-05-05 21:37:46 +09:00
pytimer
9715668586 add ProcsTotal in load 2019-05-05 10:29:20 +08:00
Omar Polo
3cbb0873de
int32 is enough -- don't waste space 2019-05-02 12:24:16 +02:00
shirou
cae8efcffa [cpu]: remove unused field Stolen
see #676
2019-04-27 13:45:12 +09:00
shirou
fa9845945e
Merge pull request #674 from lootek/more-vmstat
Add pages in/out/fault statistics (as read from vmstat)
v2.19.04
2019-04-27 12:13:43 +09:00
Marc
174b31f146 Fix for #665
Remains backward compatible.

When encountering non-fatal errors SensorsTemperatures() returns the
temperatures for all the sensor we could read successfully. In that
case the custom error contains a list of all the non-fatal errors
encountered.

Example usage:

	_, err := SensorsTemperatures()
	if err != nil {
		warns, ok := err.(*Warnings)
		if ok {
			fmt.Printf("%v\n", err)
			for i, w := range warns.List {
				fmt.Printf("Warning %v: %v\n", i+1, w)
			}
		} else {
			t.Errorf("%v", err)
		}
	}
2019-04-26 23:15:23 +08:00
lootek
1cbb212a6b
Add pages in/out/fault statistics (as read from vmstat) 2019-04-25 09:32:59 +02:00
shirou
2cbc9195c8
Merge pull request #659 from mingrammer/gofmt
Refactor with gofmt
v2.19.03
2019-03-23 22:16:28 +09:00
mingrammer
64a995aad4 Refactor with gofmt 2019-03-23 21:57:24 +09:00
shirou
68c6fbd367
Merge pull request #651 from mingrammer/go-modules
Support go modules
2019-03-23 10:02:08 +09:00
shirou
b2eb6640fb [disk][windows]: does not define ret at begining of the function.
To reduce memory when error happend. commented on #653.
2019-03-23 09:48:18 +09:00