mirror of
https://codeberg.org/icewind/palantir.git
synced 2026-06-03 18:24:08 +02:00
optimize zfs
This commit is contained in:
parent
7537958e6c
commit
5544b9984a
3 changed files with 67 additions and 40 deletions
19
src/lib.rs
19
src/lib.rs
|
|
@ -1,27 +1,17 @@
|
|||
pub(crate) mod heim;
|
||||
mod zfs;
|
||||
pub mod heim;
|
||||
pub mod zfs;
|
||||
|
||||
use crate::heim::*;
|
||||
use crate::zfs::pools;
|
||||
use color_eyre::Result;
|
||||
use futures_util::stream::StreamExt;
|
||||
use futures_util::{pin_mut, try_join};
|
||||
use std::collections::{HashMap, HashSet};
|
||||
use std::collections::HashSet;
|
||||
use std::fmt::Write;
|
||||
|
||||
pub async fn get_metrics() -> Result<String> {
|
||||
let (hostname, pools, cpu, memory, network, temperatures, disks, disk_usage): (
|
||||
String,
|
||||
Vec<DiskUsage>,
|
||||
f64,
|
||||
Memory,
|
||||
_,
|
||||
HashMap<TemperatureLabel, f32>,
|
||||
_,
|
||||
_,
|
||||
) = try_join! {
|
||||
let (hostname, cpu, memory, network, temperatures, disks, disk_usage) = try_join! {
|
||||
hostname(),
|
||||
pools(),
|
||||
cpu_time(),
|
||||
memory(),
|
||||
network_stats(),
|
||||
|
|
@ -29,6 +19,7 @@ pub async fn get_metrics() -> Result<String> {
|
|||
disk_stats(),
|
||||
disk_usage(),
|
||||
}?;
|
||||
let pools = pools();
|
||||
pin_mut!(network);
|
||||
pin_mut!(disks);
|
||||
pin_mut!(disk_usage);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue