🚧 wip: add placeholder for gauges

main
_ 2020-12-20 17:41:00 +00:00
parent b54be58abc
commit d052f42507
2 changed files with 13 additions and 1 deletions

View File

@ -31,6 +31,11 @@ pub struct PerInstance {
pub startup_utc: DateTime <Utc>,
}
#[derive (Debug, serde::Serialize)]
pub struct Gauges {
pub rss_mib: u64,
}
fn get_machine_id () -> Option <String> {
use std::{
fs::File,

View File

@ -18,7 +18,10 @@ use handlebars::Handlebars;
use reqwest::Client;
use serde::Deserialize;
use tokio::{
sync::oneshot,
sync::{
oneshot,
RwLock,
},
time::delay_for,
};
@ -52,6 +55,7 @@ struct ServerState {
config: Config,
handlebars: Handlebars <'static>,
instance_metrics: file_server::metrics::PerInstance,
gauges: RwLock <file_server::metrics::Gauges>,
client: Client,
hidden_path: Option <PathBuf>,
}
@ -210,6 +214,9 @@ pub async fn run_server (
},
handlebars,
instance_metrics,
gauges: RwLock::new (file_server::metrics::Gauges {
rss_mib: 7,
}),
client,
hidden_path,
});