Important
Planned breaking change: disk.IOCounters ReadTime / WriteTime on Windows
This release includes #2164. In a future release, the Windows values of ReadTime and WriteTime will change significantly (seconds to milliseconds). The API will not change.
On Windows, ReadTime and WriteTime are currently in seconds.
On Linux, macOS and FreeBSD they are in milliseconds.
This is a bug (#2160).
- In a future release, the default on Windows will change to milliseconds.
- This will happen when psutil fixes the same bug (giampaolo/psutil#3002), or in February 2027 at the latest.
- After that change, Windows values will be 1000x larger than now.
You can switch to milliseconds now with the new context key disk.WillBeDeletedOptInWindowsIOTimeMs:
ctx := context.WithValue(context.Background(), disk.WillBeDeletedOptInWindowsIOTimeMs, true)
stats, err := disk.IOCountersWithContext(ctx)- Without this key, nothing changes in this release.
- Other platforms ignore this key.
- This key will be removed when milliseconds become the default.
Remove it from your code at that time.
(#2164)
What's Changed
disk
- disk/windows: convert IOCounters Read/WriteTime to milliseconds by @TastyHeadphones in #2164
host
- [host][linux]: fix loginctl users fallback for systemd >= 256 by @houssemexo26 in #2168
- [host][linux]: Fall back to loginctl when utmp is unavailable by @SebastianLeitz in #2132
- [sensors][freebsd]: implement TemperaturesWithContext by @AdamMagued in #2173
mem
process
- process: keep /dev/tty* when /dev/pts is missing by @TastyHeadphones in #2167
New Contributors
- @TastyHeadphones made their first contribution in #2167
- @houssemexo26 made their first contribution in #2168
- @SebastianLeitz made their first contribution in #2132
- @AdamMagued made their first contribution in #2173
Full Changelog: v4.26.9...v4.26.10