github shirou/gopsutil v4.26.10

4 hours ago

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

host

mem

process

New Contributors

Full Changelog: v4.26.9...v4.26.10

Don't miss a new gopsutil release

NewReleases is sending notifications on new releases.