about summary refs log tree commit diff
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rwxr-xr-xsrc/main.rs10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs
index cddd2f1..cf5cda7 100755
--- a/src/main.rs
+++ b/src/main.rs
@@ -16,7 +16,10 @@ use std::{
 	io::{BufRead, BufReader, Write},
 	os::unix::fs::MetadataExt,
 	str::FromStr,
-	sync::Arc,
+	sync::{
+		atomic::{AtomicUsize, Ordering},
+		Arc,
+	},
 	time::Duration,
 };
 
@@ -51,6 +54,7 @@ use crate::{
 pub struct AwakeState {
 	pub database: Arc<Database>,
 	pub cache_path: Utf8PathBuf,
+	pub netinfo_upper_bound: Arc<AtomicUsize>,
 }
 
 #[tokio::main]
@@ -86,6 +90,7 @@ async fn main() {
 	let state = AwakeState {
 		database: Arc::new(database),
 		cache_path: cache.into(),
+		netinfo_upper_bound: Arc::new(AtomicUsize::new(256)),
 	};
 
 	match std::env::args().nth(1).as_deref() {
@@ -413,6 +418,9 @@ fn template_content(state: AwakeState, frontmatter: &Frontmatter, marked: String
 
 		doc.set("stats.mem.total", mem.total_kb / 1000);
 		doc.set("stats.mem.usage", mem.usage() / 1000);
+
+		let netinfo_upper = state.netinfo_upper_bound.load(Ordering::Relaxed);
+		doc.set("stats.net.max_bound", netinfo_upper);
 	}
 
 	doc.compile()