Replace cpu usage by load average
[valheim_web.git] / backend / src / main.rs
index 88424da..ce9ae9f 100644 (file)
@@ -21,7 +21,7 @@ mod valheim_controller;
 struct MainTemplate {
     text_status: String,
     memory: String,
-    cpu: String,
+    load_average: String,
     uptime: String
 }
 
@@ -41,12 +41,12 @@ async fn main_page(/*key_shared: web::Data<Mutex<String>>,*/ query: Query<Reques
             MainTemplate {
                 text_status: String::from("Valheim server is up and running :)"),
                 memory: info.format_memory(),
-                cpu: info.format_cpu_usage(),
+                load_average: info.format_load_average(),
                 uptime: info.format_uptime()
             },
         None => {
             let value_unknown = String::from(VALUE_UNKNOWN);
-            MainTemplate { text_status: String::from("Valheim server is down :("), memory: value_unknown.clone(), cpu: value_unknown.clone(), uptime: value_unknown.clone() }
+            MainTemplate { text_status: String::from("Valheim server is down :("), memory: value_unknown.clone(), load_average: value_unknown.clone(), uptime: value_unknown.clone() }
         }
     }