-
Notifications
You must be signed in to change notification settings - Fork 60
Open
Labels
Description
Btrfs exposes records device statistics via btrfs device stats (json or not) or via an ioctl BTRFS_IOC_GET_DEV_STATS. The stats can be obtained unprivileged.
The use case would be exposing these stats in Cockpit's btrfs device view:
I can imagine something like:
BlockDev.btrfs_filesystem_stats(mount_point)The only question is how this will be integrated in UDisks, the API is based on a Filesystem so it could be. But that can be solved later, it could also become a part of org.freedesktop.UDisks2.Manager.BTRFS.
Regarding the implementation I am open to either using the ioctl in libblockdev or btrfs --format json device stats / (see output below). I am happy to implement either:
[jelle@homeserver ~]$ btrfs --format json device stats /mnt/disk
{
"__header": {
"version": "1"
},
"device-stats": [
{
"device": "/dev/sda",
"devid": 1,
"write_io_errs": 0,
"read_io_errs": 0,
"flush_io_errs": 0,
"corruption_errs": 0,
"generation_errs": 0
},
{
"device": "/dev/sdb",
"devid": 2,
"write_io_errs": 0,
"read_io_errs": 0,
"flush_io_errs": 0,
"corruption_errs": 0,
"generation_errs": 0
}
]
}
Reactions are currently unavailable