Module proc_sys_parser::fs_xfs_stat

source ·
Expand description

Read data from /proc/fs/xfs/stat into the struct ProcFsXfsStat.

The processor of /proc/fs/xfs/stat takes the values in the file, and puts them in the struct ProcFsXfsStat. The values in the stat file are detailed data about the function of the XFS filesystem on linux.

Documentation: The documentation seems to be gone, or at least not easy to find. Using the Wayback machine I managed to find an old page that provides a good description: <https://web.archive.org/web/20220902080208/https://xfs.org/index.php/Runtime_Stats Here is an example obtaining the data from /proc/fs/xfs/stat:

use proc_sys_parser::fs_xfs_stat;

let proc_fs_xfs_stat = fs_xfs_stat::read();

println!("{:#?}", proc_fs_xfs_stat);

Example output:

ProcFsXfsStat {
    xs_write_calls: 0.0,
    xs_read_calls: 0.0,
    xs_write_bytes: 0.0,
    xs_read_bytes: 0,
}

(edited for readability)

If you want to change the path and/or file that is read for ProcFsXfsStat, which is /proc/fs/xfs/stat by default, use:

use proc_sys_parser::{meminfo, meminfo::Builder};

let proc_loadavg = Builder::new().path("/myproc").read();

Structs§

Functions§

  • The main function for building a [ProcMemInfo] struct with current data. This uses the Builder pattern, which allows settings such as the filename to specified.