1
0
mirror of https://github.com/shirou/gopsutil.git synced 2025-04-26 13:48:59 +08:00

45 Commits

Author SHA1 Message Date
shirou.wakayama
0e9c0ade3c [host][windows]: change platform version from build version to display version 2024-05-28 22:27:17 +09:00
shirou
e9591b5b01 rename redundant test function names, such as TestCPU in cpu package 2024-05-28 22:27:17 +09:00
shirou
ab0d977709 [sensors] move Temperatures from host to sensors. 2024-05-28 22:27:17 +09:00
shirou
bc060cc227 add SPDX License, remove old build tag, and replace import 2024-05-28 22:27:17 +09:00
shirou
b10acd4894 [host]: add EnableBootTimeCache function 2024-01-11 00:49:11 +09:00
shirou
4b46f2b70c [host][darwin]: fix Users 2023-10-10 23:05:52 +09:00
shirou
febdeab871 chore: change CIRCLECI environment variable to CI. 2023-08-30 14:07:47 +00:00
shirou
3748c19402 [host][linux]: remove double quote from lsb release info
fix: #1502
2023-08-13 12:01:01 +00:00
Matthieu MOREL
b673968d5d
enable errorlint linter 2021-12-04 22:29:38 +01:00
shirou
0969c9436b delete v2 directory, move v3 to top #1078 2021-11-30 23:47:59 +00:00
shirou
f377a07e5a fix test and openbsd errors. 2020-10-25 19:06:59 +09:00
Ryan Fitzpatrick
8046134504
Fix VirtualizationWithContext() race in linux 2020-10-06 17:03:49 +00:00
Lomanic
4cfc60d68b
Merge pull request #928 from Lomanic/skip-tests-when-not-implemented 2020-09-06 13:33:31 +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
Lomanic
8110480793 [host] Skip tests on non-implemented platforms #446 2020-08-29 18:39:44 +02:00
Tobias Klauser
7bee6a934d host: fix TestHostInfoStat_String
TestHostInfoStat_String has been broken since kernelArch has been
introduced. Fix it.

Also adjust the error message to show the wanted string, aligned with
the gotten string so it's easier to spot differences.
2020-02-13 14:41:11 +01:00
mingrammer
017c9f9cbc Fix typos 2019-03-18 02:52:26 +09:00
shirou
4923bd298a host: remove empty virtualzation check.
related to #547
There is an architecture which supports no virtualization.
2018-07-05 21:54:46 +09:00
Michal Rostecki
0225d9ddcc host: Check for error object 2018-06-21 16:58:40 +02:00
Steven Hartland
f846eda923 Eliminate call to uname on FreeBSD
Improve performance by eliminating the fork out to uname on FreeBSD which also helps prevent crashes / hangs due to the outstanding fork crash bug:
golang/go#15658

Also added a test for PlatformInformation.
2018-03-11 23:08:04 +00:00
shirou
d1fb05a30b Skip some test if CircleCI. 2018-01-09 11:30:38 +09:00
shirou
8b2468f1e7 Merge branch 'master' of github.com:shirou/gopsutil into feature/lxd_boot_time 2018-01-09 11:16:18 +09:00
shawnps
befc2c3d92 call Fatal if length of Users() is 0 2017-11-08 13:29:49 +09:00
shirou
dc3a09c1d0 [host] linux: change file if in a lxc container. 2017-10-22 16:39:36 +09:00
WAKAYAMA Shirou
114c78c777 [host]: add not implemented methods. 2017-08-03 11:08:35 +09:00
WAKAYAMA Shirou
9c5b318e0d [host] windows: define Virtualization() 2017-08-03 10:14:20 +09:00
Eric Gourlaouen
22aefb460a Replaced sys by HostSys
Added TemperatureStat string test
2017-03-20 19:01:28 +01:00
Shirou WAKAYAMA
85d3530ae8 fix test. 2017-03-03 22:35:18 +09:00
Alexey Galkin
2287b035c8 Add new test 'TestHostGuid'
For issue: https://github.com/shirou/gopsutil/issues/322
2017-03-03 16:28:49 +04:00
Conor Branagan
5afd6f21c9 Cache the boot time after first query.
When fetching stats on all processes at once there's a non-trivial amount of
time spent in the `BootTime` call. But since this value should never change
during a live process, we can use a cached version for all subsequent calls.
2016-10-13 11:24:29 -04:00
Lukas Fittl
13aedadcde Add separate kernelVersion field to host information.
This is mostly intended for Linux, where we are returning the OS version
in the PlatformVersion field, which seems reasonable. Often it is still
useful to know which Linux kernel is running.

For FreeBSD and Darwin the kernel version matches the platform version,
since they previously used the kernel version for the platform version.

For Windows the kernel version is empty, since there is no clear way
to determine it.
2016-08-22 14:15:30 -07:00
Sean Chittenden
59094cd5b7
Add HostID to the Host InfoStat struct returned from host.Info().
On supported hosts the value returned is a UUID (case preserving
from the value of the underlying OS).

For Linux this is generated once, randomly per boot.  For FreeBSD and
Darwin this is a more durable value that should persist across reboots.
2016-08-11 00:51:07 -07:00
Sean Chittenden
fcd296ea11
Merge branch 'master' of github.com:shirou/gopsutil 2016-07-11 01:15:11 -05:00
Sean Chittenden
69f7f8eaeb
Update host.Info() to return the number of processes on all platforms.
Fixes: #227
2016-07-10 23:47:29 -05:00
WAKAYAMA Shirou
53406b2832 [host]Windows: BootTime and Uptime are reversed on Windows. 2016-06-12 23:20:51 +09:00
WAKAYAMA shirou
e864f2a037 [disk]freebsd: update 386. 2016-04-23 23:43:00 +09:00
Shirou WAKAYAMA
4bb84648bf JSON representation is renamed to fit Google JSON style, camelCase. 2016-03-23 10:52:46 +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
0afd653fab host[all]: fix #114 String() issue. 2015-11-24 09:30:17 +09:00
Shirou WAKAYAMA
3bd9ace228 [linux] fix Host.BootTime(). It was seconds from Booted, not from epoch. 2015-06-19 12:00:04 +09:00
WAKAYAMA shirou
64f1a93c00 forget to add. 2014-12-31 22:47:22 +09:00
WAKAYAMA shirou
b0c9f81246 host_freebsd now use godefs 2014-12-31 00:30:55 +09:00
Shirou WAKAYAMA
13cd195a7e change package name. 2014-12-30 22:09:05 +09:00
Shirou WAKAYAMA
1cb67eb4c2 merge 039b9defabe2fba35c9d3a4dbf7edc3fad812227 2014-12-27 23:43:18 +09:00
Shirou WAKAYAMA
a4671fcc2a move subdirectories. refer to issue #24 2014-11-27 10:18:15 +09:00