Crates.io | procsys |
lib.rs | procsys |
version | |
source | src |
created_at | 2024-06-30 08:40:37.584691 |
updated_at | 2024-12-07 00:53:14.718845 |
description | Rust library to retrieve system, kernel, and process metrics from the pseudo-filesystems /proc and /sys |
homepage | |
repository | |
max_upload_size | |
id | 1287851 |
Cargo.toml error: | TOML parse error at line 18, column 1 | 18 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
Rust library to retrieve system, kernel, and process metrics from the pseudo-filesystems /proc and /sys.
See the docs for more information about supported features, or view the features.md file of the project repository.
There are several examples in the documents and also in the examples directory of project repository.
use procsys::sysfs::class_watchdog;
let watchdog_devices = class_watchdog::collect().expect("watchdog information");
for wdev in &watchdog_devices {
println!("name: {}", wdev.name);
println!("boot status: {}", wdev.boot_status.unwrap_or_default());
println!("timeout: {}", wdev.timeout.unwrap_or_default());
println!("min_timeout: {}", wdev.min_timeout.unwrap_or_default());
println!("max_timeout: {}", wdev.max_timeout.unwrap_or_default());
}
// print all watchdog devices information in json output
match serde_json::to_string_pretty(&watchdog_devices) {
Ok(output) => println!("{}", output),
Err(err) => {
log::error!("{}", err);
std::process::exit(1);
}
}
Licensed under the MIT License.