diff --git a/binaries/geph5-broker/src/rpc_impl.rs b/binaries/geph5-broker/src/rpc_impl.rs index e5f2b94..7483058 100644 --- a/binaries/geph5-broker/src/rpc_impl.rs +++ b/binaries/geph5-broker/src/rpc_impl.rs @@ -272,11 +272,8 @@ impl BrokerProtocol for BrokerImpl { ) .await { - match route { - Ok(route) => routes.push(route), - Err(err) => { - tracing::warn!(err = debug(err), "could not communicate") - } + if let Ok(route) = route { + routes.push(route) } } diff --git a/binaries/geph5-broker/src/self_stat.rs b/binaries/geph5-broker/src/self_stat.rs index 33a257b..31ea7f1 100644 --- a/binaries/geph5-broker/src/self_stat.rs +++ b/binaries/geph5-broker/src/self_stat.rs @@ -42,6 +42,12 @@ pub async fn self_stat_loop() -> anyhow::Result<()> { .fetch_one(&*POSTGRES) .await?; client.gauge("broker.daily_logins", daily_logins as f64)?; + let (weekly_logins,): (i64,) = sqlx::query_as( + "select count(id) from last_login where login_time > NOW() - INTERVAL '7 days'", + ) + .fetch_one(&*POSTGRES) + .await?; + client.gauge("broker.weekly_logins", weekly_logins as f64)?; } async_io::Timer::after(Duration::from_secs(5)).await; }