mirror of
https://github.com/rustfs/rustfs.git
synced 2026-09-03 02:38:12 +00:00
feat(admin): expose global heal progress (#3897)
This commit is contained in:
@@ -18,7 +18,7 @@ pub mod heal;
|
||||
pub use error::{Error, Result};
|
||||
pub use heal::{
|
||||
HealManager, HealOperationsSnapshot, HealOptions, HealPriority, HealPriorityCounts, HealRequest, HealSourceCounts, HealType,
|
||||
channel::HealChannelProcessor,
|
||||
channel::HealChannelProcessor, progress::HealProgress,
|
||||
};
|
||||
use rustfs_concurrency::WorkloadAdmissionSnapshotProvider;
|
||||
use std::sync::atomic::{AtomicU64, Ordering};
|
||||
@@ -163,6 +163,14 @@ pub async fn current_heal_operations_snapshot() -> HealOperationsSnapshot {
|
||||
}
|
||||
}
|
||||
|
||||
pub async fn current_heal_progress_snapshot() -> Option<HealProgress> {
|
||||
if let Some(manager) = get_heal_manager() {
|
||||
manager.active_progress_snapshot().await
|
||||
} else {
|
||||
None
|
||||
}
|
||||
}
|
||||
|
||||
fn usize_to_u64_saturated(value: usize) -> u64 {
|
||||
u64::try_from(value).unwrap_or(u64::MAX)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user