add version info to health endpoint
This commit is contained in:
parent
2fa785c1de
commit
1ae0533f2d
1 changed files with 2 additions and 0 deletions
|
|
@ -99,6 +99,7 @@ pub async fn put_cache_item(
|
|||
|
||||
#[derive(Serialize)]
|
||||
pub struct HealthStatus {
|
||||
pub version: &'static str,
|
||||
pub cache_entries: usize,
|
||||
pub cache_size: u64,
|
||||
pub cache_capacity: u64,
|
||||
|
|
@ -123,6 +124,7 @@ pub async fn get_heath_status(app_data: Data<AppState>, auth: BearerAuth) -> imp
|
|||
let now = SystemTime::now();
|
||||
if let Ok(shared) = app_data.shared.read() {
|
||||
HttpResponse::Ok().json(HealthStatus {
|
||||
version: env!("CARGO_PKG_VERSION"),
|
||||
cache_entries: shared.lru_cache.len(),
|
||||
cache_size: shared.stats.cache_size,
|
||||
cache_capacity: app_data.config.max_cache_size.unwrap_or(u64::MAX),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue