Skip to content

Commit 6868478

Browse files
committed
vmstat: add basic implementation of vmstat
1 parent d1bd104 commit 6868478

File tree

6 files changed

+365
-0
lines changed

6 files changed

+365
-0
lines changed

Cargo.lock

Lines changed: 75 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ feat_common_core = [
3939
"sysctl",
4040
"tload",
4141
"top",
42+
"vmstat",
4243
"w",
4344
"watch",
4445
]
@@ -55,6 +56,7 @@ nix = { version = "0.29", default-features = false, features = ["process"] }
5556
phf = "0.11.2"
5657
phf_codegen = "0.11.2"
5758
prettytable-rs = "0.10.0"
59+
procfs = "0.17.0"
5860
rand = { version = "0.9.0", features = ["small_rng"] }
5961
ratatui = "0.29.0"
6062
regex = "1.10.4"
@@ -92,6 +94,7 @@ snice = { optional = true, version = "0.0.1", package = "uu_snice", path = "src/
9294
sysctl = { optional = true, version = "0.0.1", package = "uu_sysctl", path = "src/uu/sysctl" }
9395
tload = { optional = true, version = "0.0.1", package = "uu_tload", path = "src/uu/tload" }
9496
top = { optional = true, version = "0.0.1", package = "uu_top", path = "src/uu/top" }
97+
vmstat = { optional = true, version = "0.0.1", package = "uu_vmstat", path = "src/uu/vmstat" }
9598
w = { optional = true, version = "0.0.1", package = "uu_w", path = "src/uu/w" }
9699
watch = { optional = true, version = "0.0.1", package = "uu_watch", path = "src/uu/watch" }
97100

src/uu/vmstat/Cargo.toml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
[package]
2+
name = "uu_vmstat"
3+
version = "0.0.1"
4+
edition = "2021"
5+
authors = ["uutils developers"]
6+
license = "MIT"
7+
description = "vmstat ~ (uutils) Report virtual memory statistics."
8+
9+
homepage = "https://github.com/uutils/procps"
10+
repository = "https://github.com/uutils/procps/tree/main/src/uu/vmstat"
11+
keywords = ["acl", "uutils", "cross-platform", "cli", "utility"]
12+
categories = ["command-line-utilities"]
13+
14+
[dependencies]
15+
uucore = { workspace = true }
16+
clap = { workspace = true }
17+
18+
[target.'cfg(target_os="linux")'.dependencies]
19+
procfs = { workspace = true }
20+
21+
[lib]
22+
path = "src/vmstat.rs"
23+
24+
[[bin]]
25+
name = "vmstat"
26+
path = "src/main.rs"

src/uu/vmstat/src/main.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
uucore::bin!(uu_vmstat);

0 commit comments

Comments
 (0)