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

50 Commits

Author SHA1 Message Date
shirou
bc060cc227 add SPDX License, remove old build tag, and replace import 2024-05-28 22:27:17 +09:00
Ozan HACIBEKİROĞLU
1ed7ea75d7 fix: fixed windows disk package leaks
- fixed goroutine leak in PartitionsWithContext
- closed registry handle in init
2023-08-10 14:48:26 +03:00
shirou
586926508c
Merge pull request #1431 from powersj/fix/1429
fix: moves common.Warnings to common OS files
2023-03-19 22:41:51 +09:00
Josh Powers
e7c6b6991d
fix: moves common.Warnings to common OS files
This allows all OS types to unwrap the Warnings from errors, and not
just linux in host or windows in disk.

fixes: #1429
2023-03-15 06:39:08 -06:00
David Newhall II
3a88ef27a5 close channel in function that sends to it 2023-03-13 20:09:01 -07:00
shirou
8105a6d577 [disk][windows]: add context handling on PartionsWithContext 2023-01-14 17:59:36 +09:00
shirou
a0f8443561
Revert "[disk][windows] Support LabelWithContext & SerialNumberWithContext - rebased " 2022-12-01 08:42:17 +09:00
shirou
af44f9d16b
Merge pull request #1367 from FrankSpitulski/feat/implement-label-windows
[disk][windows] Support LabelWithContext & SerialNumberWithContext - rebased
2022-12-01 08:34:29 +09:00
shirou
5473fd114d [disk][host]: change to use type alias. 2022-11-30 23:23:31 +00:00
shirou
4ac7e99c6a [disk][host]: move back Warnings from internal to disk and host.
fix #1377
2022-11-19 11:37:38 +00:00
Frank Spitulski
d7c791252a rebase on master 2022-10-19 19:19:59 -07:00
Matthew Palmer
b515acb162 [disk][windows] Support LabelWithContext & SerialNumberWithContext
Add support for LabelWithContext & SerialNumberWithContext, additionally returning this data back for the IOCountersWithContext function.
2022-10-19 19:10:01 -07:00
Antoine Toulme
dbc0f20fe3 code review 2022-10-03 13:55:14 -07:00
Antoine Toulme
6b2bfe408d Return all partitions on Windows and all errors rather than returning early 2022-09-06 23:13:22 -07:00
Lomanic
2318b5e69f [disk][windows] Set EnableCounterForIoctl reg key to 1 in init() to automatically enable diskperf on Server editions
Fixes #1094
2022-05-05 22:33:24 +02:00
mmorel-35
1e6b445a8a gofumpt 2021-12-22 21:54:41 +00:00
shirou
0969c9436b delete v2 directory, move v3 to top #1078 2021-11-30 23:47:59 +00:00
shirou
1f733a99dc [disk] move without context functions to disk.go. 2020-10-24 22:03:58 +09:00
Sergey Vinogradov
8ff2ab3187 Add "vet" target to the Makefile
Making the "vet" target will run "go vet ./..." for each supported
GOOS.

Also, some of the warnings produced by go 1.15 vet were mitigated.
2020-10-10 16:50:49 +03:00
Lomanic
f98100720e [process][windows] Fix #846 use win32 API in disk.IOCounters() instead of slow WMI call returning wrong values 2020-03-13 23:57:17 +01: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
shirou
852c7686b5
Merge pull request #613 from tmm1/allow-a-b-windows-drives
do not ignore A: and B: drives on windows
2018-11-21 20:19:05 +09:00
Aman Gupta
d021425af3 do not ignore A: and B: drives on windows
from https://www.howtogeek.com/122891/what-are-the-windows-a-and-b-drives-used-for/

>if your computer does not have floppy disk drives, you can assign A and B to volumes
2018-11-20 13:09:36 -08:00
Aman Gupta
ab57d4a5fe fix minor typo in disk_windows 2018-11-20 13:04:18 -08:00
shirou
8563278a9d Revert "Merge pull request #541 from sify21/fix_435"
This reverts commit a9c2f23bc2fcea5d4da58d476a2b2da6cb7fb214, reversing
changes made to ebfe800cf98758137226a1e90122a1c0569dd9dd.
2018-06-24 00:46:27 +09:00
司芳源
1b641b25eb not export custom types 2018-06-22 16:18:18 +08:00
司芳源
98cd971621 wrong variable 2018-06-22 10:03:04 +08:00
司芳源
facd46a4a5 Implement disk.GetDiskSerialNumber for Windows via WMI. Parameter should be drive letter, so it can be used in IOCountersStat. See last part of https://msdn.microsoft.com/en-us/library/windows/desktop/aa394592(v=vs.85).aspx. 2018-06-22 09:34:39 +08:00
sada
8dd42707e2 windows: fix WithContext functions
set timeout only if parent context doesn't set.
2018-02-12 13:26:17 -08:00
shirou
4c73494c78 Add WithContext functions. 2017-12-31 15:25:49 +09:00
leaf
65598d98cc To prevent hang if wmi.Query hangs, add a context-aware wrapper for it. 2017-11-20 10:13:27 -08:00
Sean Chittenden
635b971c0e
Move from the syscall package to the golang.org/x/sys/{unix,windows} 2017-06-02 13:51:00 -07:00
shirou
37c114fe6c Merge pull request #366 from tmm1/patch-2
Ignore GetVolumeInformation errors on DRIVE_REMOVABLE volumes
2017-05-09 10:15:49 +09:00
Aman Gupta
f2cbbac707 Ignore GetVolumeInformation errors on DRIVE_REMOVABLE volumes 2017-05-08 14:23:46 -07:00
Aman Gupta
b59c2a2be3 Include "DRIVE_REMOTE" volumes on windows 2017-05-08 09:50:38 -07:00
Daniel Nelson
3830ed16b4
Make IOCounters a variadic function
Remove IOCountersForNames that was recently added in favor of variadic
function with same capabilities.
2017-04-13 18:53:09 -07:00
WAKAYAMA Shirou
dfbb3e40da fix build bugs. 2017-04-10 22:24:36 +09:00
Daniel Nelson
3f35f001da
Add disk.IOCountersForNames function
Operates like disk.IOCounters, but accepts an array of names to limit
the results.
2017-04-06 18:00:54 -07: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
7288e9a5af common[all]: add internal 2015-10-20 00:04:57 +09:00
WAKAYAMA Shirou
773d9d3caa disk[windows]: change to use WMI to get disk io counter information. 2015-09-05 22:53:18 +09:00
Ben Aldrich
0fab61e73e remove log message 2015-09-04 13:41:08 -06:00
Ben Aldrich
6c000b035d don't fail if cd is not in a drive
add used and usedPercent back in
2015-09-04 11:51:34 -06:00
Ben Aldrich
85a89e707b fix compile fail 2015-09-02 11:27:47 -06:00
Cameron Sparr
1a037fddb1 Fix disk usage stats for windows 2015-08-27 09:51:03 -06:00
WAKAYAMA Shirou
612e7109e1 delete debug 2015-02-19 23:53:54 +09:00
WAKAYAMA Shirou
bb1747fc85 disk: implements DiskIoCounterInfo on windows. Note: only read/write counts during 500 msec.
Thanks for mackerel-agent!
2015-02-19 23:52:06 +09:00
Shirou WAKAYAMA
13cd195a7e change package name. 2014-12-30 22:09:05 +09:00
WAKAYAMA Shirou
9f2c985a28 fix windows build. 2014-11-27 22:28:05 +09:00
Shirou WAKAYAMA
a4671fcc2a move subdirectories. refer to issue #24 2014-11-27 10:18:15 +09:00