mirror of
https://github.com/moghtech/komodo.git
synced 2026-05-03 11:00:16 -05:00
periphery 0.1.2 remove disk filter
This commit is contained in:
Generated
+1
-1
@@ -1406,7 +1406,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "monitor_periphery"
|
||||
version = "0.1.1"
|
||||
version = "0.1.2"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"async_timing_util",
|
||||
|
||||
+5
-4
@@ -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()
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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,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"
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user