From 22a8845c53b1e2af7f6e87812e3f5a8b43d7b2e4 Mon Sep 17 00:00:00 2001 From: beckerinj Date: Sun, 4 Dec 2022 04:11:27 -0500 Subject: [PATCH] clean up old stats --- lib/periphery_client/src/lib.rs | 7 +++++-- lib/periphery_client/src/stats.rs | 13 ------------- lib/types/src/traits.rs | 2 +- 3 files changed, 6 insertions(+), 16 deletions(-) delete mode 100644 lib/periphery_client/src/stats.rs diff --git a/lib/periphery_client/src/lib.rs b/lib/periphery_client/src/lib.rs index a38180385..238a47d7d 100644 --- a/lib/periphery_client/src/lib.rs +++ b/lib/periphery_client/src/lib.rs @@ -1,13 +1,12 @@ use anyhow::{anyhow, Context}; use reqwest::StatusCode; use serde::{de::DeserializeOwned, Serialize}; -use types::Server; +use types::{Server, SystemStats}; mod build; mod container; mod git; mod network; -mod stats; pub struct PeripheryClient { http_client: reqwest::Client, @@ -32,6 +31,10 @@ impl PeripheryClient { self.get_json(server, "/accounts/docker").await } + pub async fn get_system_stats(&self, server: &Server) -> anyhow::Result { + self.get_json(server, "/stats/system").await + } + async fn get_text(&self, server: &Server, endpoint: &str) -> anyhow::Result { let res = self .http_client diff --git a/lib/periphery_client/src/stats.rs b/lib/periphery_client/src/stats.rs deleted file mode 100644 index 21e24d301..000000000 --- a/lib/periphery_client/src/stats.rs +++ /dev/null @@ -1,13 +0,0 @@ -use types::{Server, SystemStats}; - -use crate::PeripheryClient; - -impl PeripheryClient { - pub async fn get_system_stats(&self, server: &Server) -> anyhow::Result { - self.get_json(server, "/stats/system").await - } - - pub async fn get_docker_stats(&self, server: &Server) -> anyhow::Result { - self.get_json(server, "/stats/docker").await - } -} diff --git a/lib/types/src/traits.rs b/lib/types/src/traits.rs index a1a7840a5..6a9f93453 100644 --- a/lib/types/src/traits.rs +++ b/lib/types/src/traits.rs @@ -24,4 +24,4 @@ impl Permissioned for Server { fn permissions_map(&self) -> &PermissionsMap { &self.permissions } -} +} \ No newline at end of file