simple_server_status

Crates.iosimple_server_status
lib.rssimple_server_status
version0.2.4
sourcesrc
created_at2022-05-29 06:17:49.267403
updated_at2024-08-08 20:27:48.649069
descriptionSimple cpu, ram, net, and tcp status for Linux servers
homepage
repositoryhttps://github.com/finnbear/simple_server_status/
max_upload_size
id596326
size26,258
Finn Bear (finnbear)

documentation

README

simple_server_status

A simple and fast way to get server status on Linux systems.

Features

All features except conntrack are enabled by default:

  • CPU (cpu)
    • cpu_usage() -> Option<f32> (0.0..=1.0)
    • cpu_local_usage() -> Option<f32> (0.0..=1.0)
    • cpu_stolen_usage() -> Option<f32> (0.0..=1.0, useful on VPS's to measure noisy neighbors)
  • Network (net)
    • net_bandwidth() -> Option<u64> (bytes/s)
    • net_reception_bandwidth() -> Option<u64> (bytes/s)
    • net_transmission_bandwidth() -> Option<u64> (bytes/s)
  • RAM (ram)
    • ram_usage() -> Option<f32> (0.0..=1.0)
    • ram_swap_usage() -> Option<f32> (0.0..=1.0)
  • TCP (tcp)
    • tcp_connections() -> Option<usize> (count)
  • UDP (udp)
    • udp_sockets() -> Option<usize> (count)
  • Conntrack (conntrack)
    • conntrack_sessions() -> Option<usize> (count)

Note: Must call update() first, to make a measurement.

Limitations

Only supports Linux for now. Will return Err, None, or 0 on unsupported platforms, depending on the operation.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Commit count: 7

cargo fmt