reorganize snapshot stats, implement detailed summary

This commit is contained in:
postscriptum 2026-03-22 22:49:10 +02:00
parent 9b9c47cbb9
commit 4658e2c481
3 changed files with 47 additions and 24 deletions

View file

@ -11,14 +11,14 @@ use list::List;
use log::*;
use opt::{AuthMode, Opt};
use rocket::{State, http::Status, serde::json::Json};
use stats::{Snapshot, Total};
use stats::{Snap, Total};
use std::{future::Future, sync::Arc};
use structopt::StructOpt;
use tokio::{net::TcpListener, task};
#[rocket::get("/")]
async fn index(totals: &State<Arc<Total>>) -> Json<Snapshot> {
Json(totals.inner().snapshot())
async fn index(totals: &State<Arc<Total>>) -> Json<Snap> {
Json(totals.inner().snap())
}
#[rocket::get("/allow/<rule>")]