mirror of
https://codeberg.org/icewind/palantir.git
synced 2026-06-03 18:24:08 +02:00
all stats are sync now
This commit is contained in:
parent
90dbaf071d
commit
289161fc6f
3 changed files with 2 additions and 5 deletions
|
|
@ -2,11 +2,9 @@ use iai::black_box;
|
||||||
use palantir::get_metrics;
|
use palantir::get_metrics;
|
||||||
use palantir::sensors::{cpu_time, disk_stats, disk_usage, memory, network_stats, temperatures};
|
use palantir::sensors::{cpu_time, disk_stats, disk_usage, memory, network_stats, temperatures};
|
||||||
use palantir::zfs::pools;
|
use palantir::zfs::pools;
|
||||||
use tokio::runtime::Runtime;
|
|
||||||
|
|
||||||
fn iai_get_metrics() -> String {
|
fn iai_get_metrics() -> String {
|
||||||
let rt = Runtime::new().unwrap();
|
black_box(get_metrics().unwrap())
|
||||||
rt.block_on(async { black_box(get_metrics().await.unwrap()) })
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn iai_zfs_pool() {
|
fn iai_zfs_pool() {
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ use crate::zfs::pools;
|
||||||
use color_eyre::Result;
|
use color_eyre::Result;
|
||||||
use std::fmt::Write;
|
use std::fmt::Write;
|
||||||
|
|
||||||
pub async fn get_metrics() -> Result<String> {
|
pub fn get_metrics() -> Result<String> {
|
||||||
let disk_usage = disk_usage()?;
|
let disk_usage = disk_usage()?;
|
||||||
let disks = disk_stats()?;
|
let disks = disk_stats()?;
|
||||||
let cpu = cpu_time()?;
|
let cpu = cpu_time()?;
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,6 @@ impl Reject for ReportRejection {}
|
||||||
|
|
||||||
async fn serve_metrics() -> Result<String, Rejection> {
|
async fn serve_metrics() -> Result<String, Rejection> {
|
||||||
get_metrics()
|
get_metrics()
|
||||||
.await
|
|
||||||
.map_err(ReportRejection::from)
|
.map_err(ReportRejection::from)
|
||||||
.map_err(warp::reject::custom)
|
.map_err(warp::reject::custom)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue