Skip to content

Commit

Permalink
Added version for Server stats..
Browse files Browse the repository at this point in the history
  • Loading branch information
borjamunozf committed Jan 25, 2023
1 parent 412f7e0 commit 3705606
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -889,12 +889,14 @@ where
async fn get_info(&self) -> Result<ServerInfo> {
let stats = self.stats.read().await.clone();
let cache_location = self.storage.location();
let version = env!("CARGO_PKG_VERSION").to_string();
futures::try_join!(self.storage.current_size(), self.storage.max_size()).map(
move |(cache_size, max_cache_size)| ServerInfo {
stats,
cache_location,
cache_size,
max_cache_size,
version,
},
)
}
Expand Down Expand Up @@ -1409,6 +1411,7 @@ pub struct ServerInfo {
pub cache_location: String,
pub cache_size: Option<u64>,
pub max_cache_size: Option<u64>,
pub version: String,
}

/// Status of the dist client.
Expand Down Expand Up @@ -1605,6 +1608,12 @@ impl ServerInfo {
self.cache_location,
name_width = name_width
);
println!(
"{:<name_width$} {}",
"Version (client)",
self.version,
name_width = name_width
);
for &(name, val) in &[
("Cache size", &self.cache_size),
("Max cache size", &self.max_cache_size),
Expand Down

0 comments on commit 3705606

Please sign in to comment.