From 255307a4f72ae2152ad4c25b5f048e2e3c1ac5e6 Mon Sep 17 00:00:00 2001 From: Matthew Esposito Date: Wed, 31 May 2023 20:02:00 -0400 Subject: [PATCH] Add request stats to instance info HTML --- src/instance_info.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/instance_info.rs b/src/instance_info.rs index 58c311f..3a2cb05 100644 --- a/src/instance_info.rs +++ b/src/instance_info.rs @@ -128,6 +128,8 @@ impl InstanceInfo { ["Deploy timestamp", &self.deploy_unix_ts.to_string()], ["Compile mode", &self.compile_mode], ["SFW only", &convert(&self.config.sfw_only)], + ["Reddit request count", &self.reddit_requests.load(std::sync::atomic::Ordering::SeqCst).to_string()], + ["Total request count", &self.total_requests.load(std::sync::atomic::Ordering::SeqCst).to_string()], ]) .with_header_row(["Settings"]), ); @@ -161,6 +163,8 @@ impl InstanceInfo { Deploy timestamp: {}\n Compile mode: {}\n SFW only: {:?}\n + Reddit request count: {}\n + Total request count: {}\n Config:\n Banner: {:?}\n Hide awards: {:?}\n @@ -181,6 +185,8 @@ impl InstanceInfo { self.deploy_unix_ts, self.compile_mode, self.config.sfw_only, + self.reddit_requests.load(std::sync::atomic::Ordering::SeqCst), + self.total_requests.load(std::sync::atomic::Ordering::SeqCst), self.config.banner, self.config.default_hide_awards, self.config.default_theme,