periphery 0.1.2 remove disk filter

This commit is contained in:
mbecker20
2023-01-10 17:04:50 +00:00
parent 143d855ad7
commit ca80fb4d28
5 changed files with 18 additions and 18 deletions
Generated
+1 -1
View File
@@ -1406,7 +1406,7 @@ dependencies = [
[[package]]
name = "monitor_periphery"
version = "0.1.1"
version = "0.1.2"
dependencies = [
"anyhow",
"async_timing_util",
+5 -4
View File
@@ -458,11 +458,12 @@ pub fn gen_periphery_service_file(sub_matches: &ArgMatches) {
let output = run_command_pipe_to_terminal("systemctl daemon-reload");
if output.success() {
println!(
"\n✅ successfully added service to systemd ✅\n"
)
println!("\n✅ successfully added service to systemd ✅\n")
} else {
eprintln!("\n❌ there was some {} adding service to systemd ❌\n", "error".red())
eprintln!(
"\n❌ there was some {} adding service to systemd ❌\n",
"error".red()
)
}
}
+2 -1
View File
@@ -6,8 +6,9 @@ use monitor_types::{
};
use serde_json::{json, Value};
use tokio::{
select,
sync::broadcast::{self, Receiver},
task::JoinHandle, select,
task::JoinHandle,
};
use tokio_tungstenite::{connect_async, tungstenite::Message};
use tokio_util::sync::CancellationToken;
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "monitor_periphery"
version = "0.1.1"
version = "0.1.2"
edition = "2021"
authors = ["MoghTech"]
description = "monitor periphery binary | run monitor periphery as system daemon"
+9 -11
View File
@@ -226,17 +226,15 @@ impl StatsClient {
for disk in self.sys.disks() {
let mount = disk.mount_point().to_owned();
let mount_str = mount.to_str().unwrap();
if mount_str == "/" || mount_str.contains("external") {
let disk_total = disk.total_space() as f64 / BYTES_PER_GB;
let disk_free = disk.available_space() as f64 / BYTES_PER_GB;
total_gb += disk_total;
free_gb += disk_free;
disks.push(SingleDiskUsage {
mount,
used_gb: disk_total - disk_free,
total_gb: disk_total,
});
}
let disk_total = disk.total_space() as f64 / BYTES_PER_GB;
let disk_free = disk.available_space() as f64 / BYTES_PER_GB;
total_gb += disk_total;
free_gb += disk_free;
disks.push(SingleDiskUsage {
mount,
used_gb: disk_total - disk_free,
total_gb: disk_total,
});
}
let used_gb = total_gb - free_gb;
let mut read_bytes = 0;