Skip to content

Commit

Permalink
Merge pull request #27 from navidys/develop
Browse files Browse the repository at this point in the history
added /proc/<pid>/net/netstat
  • Loading branch information
navidys authored Aug 25, 2024
2 parents 9ea7788 + dfba048 commit 8700450
Show file tree
Hide file tree
Showing 4 changed files with 1,121 additions and 0 deletions.
2 changes: 2 additions & 0 deletions FEATURES.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ Supported Features
* limits
* root
* ns
* net/
* netstat

*`/proc/buddyinfo`

Expand Down
14 changes: 14 additions & 0 deletions examples/process_netstat.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
use procsys::process;

fn main() {
let sys_proc = process::collect(2).expect("system proc 2");
let sys_proc_netstat = sys_proc.netstat().expect("system proc 2 netstat");

match serde_json::to_string_pretty(&sys_proc_netstat) {
Ok(output) => println!("{}", output),
Err(err) => {
log::error!("{}", err);
std::process::exit(1);
}
}
}
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ pub mod process;
pub mod process_cgroup;
pub mod process_io;
pub mod process_limits;
pub mod process_netstat;
pub mod process_ns;
pub mod swaps;
pub mod sysfs;
Expand Down
Loading

0 comments on commit 8700450

Please sign in to comment.