procshot_server 
rust crate (refer this for crate documentation) to record /proc stats periodically. This library just records the stats. Processing may be done separate.
Server example
use ;
use process;
use get_current_uid;
use procshot_client;
const DATADIR: &'static str = "/var/log/procshot/data";
This will generate a binary with the following cli options
)
Client example on how to read the stored data
use File;
use Read;
use EncoDecode;
Sample output of stored data
$ sudo ./target/release/procshot
Decoded test file data: EncoDecode {
hostname: "localghost",
pid_map_list: [
{
1: PidStatus {
ppid: 0,
euid: 0,
cmd_long: [
"/sbin/init",
],
name: "systemd",
cmd_short: "systemd",
tracerpid: 0,
fdsize: 256,
state: "S (sleeping)",
vmpeak: Some(
252840,
),
vmsize: Some(
187304,
),
rss_pages: 2565,
rss_bytes: 10506240,
rsslim_bytes: 18446744073709551615,
processor_last_executed: Some(
11,
),
utime: 62,
stime: 377,
},
},
{
373: PidStatus {
ppid: 1,
euid: 0,
cmd_long: [
"/usr/lib/systemd/systemd-journald",
],
name: "systemd-journal",
cmd_short: "systemd-journal",
tracerpid: 0,
fdsize: 256,
state: "S (sleeping)",
vmpeak: Some(
56756,
),
vmsize: Some(
49068,
),
rss_pages: 2486,
rss_bytes: 10182656,
rsslim_bytes: 18446744073709551615,
processor_last_executed: Some(
2,
),
utime: 50,
stime: 39,
},
},
..... snip .....
time_epoch: 1563617611,
delay: 5,
total_cpu_time: 6331606,