MCPcopy Create free account
hub / github.com/prometheus/procfs / SysBlockDeviceRotational

Method SysBlockDeviceRotational

blockdevice/stats.go:500–502  ·  view source on GitHub ↗

SysBlockDeviceRotational returns the rotational value for the block device from /sys/block/ /queue/rotational. A value of 1 indicates a rotational device (HDD), 0 indicates a non-rotational device (SSD, NVMe). An error is returned if the file cannot be read or does not contain a valid integer

(device string)

Source from the content-addressed store, hash-verified

498// non-rotational device (SSD, NVMe). An error is returned if the file
499// cannot be read or does not contain a valid integer.
500func (fs FS) SysBlockDeviceRotational(device string) (uint64, error) {
501 return parsers.ReadUintFromFile(fs.sys.Path(sysBlockPath, device, sysBlockQueue, "rotational"))
502}
503
504// SysBlockDeviceIO returns stats for the block device io counters
505// IO done count: /sys/block/<disk>/device/iodone_cnt

Callers 1

Calls 2

ReadUintFromFileFunction · 0.92
PathMethod · 0.45

Tested by 1